Skip to content

Commit

Permalink
Shrink content and improve rendering performance
Browse files Browse the repository at this point in the history
Summarize the definition of Content.
Unification of content variable names.
  • Loading branch information
noborus committed Dec 16, 2024
1 parent 7e3596b commit c7a9d7b
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 c7a9d7b

Please sign in to comment.