mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 18:22:09 +02:00
Manually specify the closing SGR for a span
This commit is contained in:
@@ -21,16 +21,16 @@ func TestInsertFormatting(t *testing.T) {
|
||||
test(
|
||||
"\x1b[44m abcd \x1b[49m",
|
||||
"\x1b[44m a\x1b[33;41mbc\x1b[39;49m\x1b[44md \x1b[49m",
|
||||
NewSpan(2, 2).SetForeground(3).SetBackground(1),
|
||||
NewSpan(2, 2).SetForeground(3).SetBackground(1).SetClosingForeground(nil).SetClosingBackground(nil),
|
||||
)
|
||||
test(
|
||||
"abcd",
|
||||
"a\x1b[92mbcd\x1b[39m",
|
||||
NewSpan(1, 11).SetForeground(10),
|
||||
NewSpan(1, 11).SetForeground(10).SetClosingForeground(nil),
|
||||
)
|
||||
test(
|
||||
"AB\x1b[1mC\x1b[221mDE",
|
||||
"A\x1b[37mB\x1b[1mC\x1b[221mDE\x1b[39m\x1b[221m",
|
||||
NewSpan(1, 11).SetForeground(7),
|
||||
NewSpan(1, 11).SetForeground(7).SetClosingForeground(nil),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user