1
0
mirror of https://github.com/gizak/termui.git synced 2025-04-24 13:48:50 +08:00

Merge 2b1178ddc3f3aa7e599ea7f0d5458663ba963420 into 2b8f0c7960e9553acea6d579a740713066da5e13

This commit is contained in:
Jigish Patel 2024-01-30 02:58:06 -08:00 committed by GitHub
commit 4498d4f81d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -63,7 +63,7 @@ func readStyle(runes []rune, defaultStyle Style) Style {
case tokenBg:
style.Bg = StyleParserColorMap[pair[1]]
case tokenModifier:
style.Modifier = modifierMap[pair[1]]
style.Modifier |= modifierMap[pair[1]]
}
}
}

View File

@ -44,15 +44,17 @@ func (self *List) Draw(buf *Buffer) {
// draw rows
for row := self.topRow; row < len(self.Rows) && point.Y < self.Inner.Max.Y; row++ {
cells := ParseStyles(self.Rows[row], self.TextStyle)
var cells []Cell
if row == self.SelectedRow {
cells = ParseStyles(self.Rows[row], self.SelectedRowStyle)
} else {
cells = ParseStyles(self.Rows[row], self.TextStyle)
}
if self.WrapText {
cells = WrapCells(cells, uint(self.Inner.Dx()))
}
for j := 0; j < len(cells) && point.Y < self.Inner.Max.Y; j++ {
style := cells[j].Style
if row == self.SelectedRow {
style = self.SelectedRowStyle
}
if cells[j].Rune == '\n' {
point = image.Pt(self.Inner.Min.X, point.Y+1)
} else {