Skip to content

Commit

Permalink
Merge pull request #669 from noborus/shrink-content
Browse files Browse the repository at this point in the history
Shrink content and improve rendering performance
  • Loading branch information
noborus authored Dec 16, 2024
2 parents 7e3596b + c7a9d7b commit 0c570b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 3 additions & 0 deletions oviewer/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ var SpaceContent = content{
style: tcell.StyleDefault,
}

// Shrink is a character that represents a shrunk column.
var Shrink rune = '…'

// ShrinkContent is a content that represents a shrunk column.
var ShrinkContent = content{
mainc: Shrink,
Expand Down
6 changes: 3 additions & 3 deletions oviewer/draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ func (root *Root) drawNoWrapLine(y int, startX int, lN int, lineC LineC) (int, i
root.clearEOL(root.scr.startX+x, y, lineC.eolStyle)
break
}
content := DefaultContent
c := DefaultContent
if startX+x >= 0 {
content = lineC.lc[startX+x]
c = lineC.lc[startX+x]
}
root.Screen.SetContent(root.scr.startX+x, y, content.mainc, content.combc, content.style)
root.Screen.SetContent(root.scr.startX+x, y, c.mainc, c.combc, c.style)
}
lN++

Expand Down
2 changes: 0 additions & 2 deletions oviewer/oviewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,6 @@ const (
nameGeneral string = "general"
)

var Shrink rune = '…'

var (
// ErrOutOfRange indicates that value is out of range.
ErrOutOfRange = errors.New("out of range")
Expand Down

0 comments on commit 0c570b8

Please sign in to comment.