Skip to content

Commit eed6a79

Browse files
committed
fixes #769 UnderlineStyle is displayed, but UnderlineColor is not
1 parent 6833fce commit eed6a79

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tscreen.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -387,22 +387,22 @@ func (t *tScreen) prepareUnderlines() {
387387
// practice since these were introduced at about the same time.
388388
if t.ti.UnderlineColor != "" {
389389
t.underColor = t.ti.UnderlineColor
390-
} else if t.ti.CurlyUnderline != "" {
390+
} else if t.curlyUnder != "" {
391391
t.underColor = "\x1b[58:5:%p1%dm"
392392
}
393393
if t.ti.UnderlineColorRGB != "" {
394394
// An interesting wart here is that in order to facilitate
395395
// using just a single parameter, the Setulc parameter takes
396396
// the 24-bit color as an integer rather than separate bytes.
397397
// This matches the "new" style direct color approach that
398-
// ncurses took, even though everyone else when another way.
398+
// ncurses took, even though everyone else went another way.
399399
t.underRGB = t.ti.UnderlineColorRGB
400-
} else if t.ti.CurlyUnderline != "" {
400+
} else if t.underColor != "" {
401401
t.underRGB = "\x1b[58:2::%p1%d:%p2%d:%p3%dm"
402402
}
403403
if t.ti.UnderlineColorReset != "" {
404404
t.underFg = t.ti.UnderlineColorReset
405-
} else if t.ti.CurlyUnderline != "" {
405+
} else if t.curlyUnder != "" {
406406
t.underFg = "\x1b[59m"
407407
}
408408
}
@@ -1529,15 +1529,15 @@ func (t *tScreen) parseClipboard(buf *bytes.Buffer, evs *[]Event) (bool, bool) {
15291529

15301530
for _, c := range b {
15311531
// valid base64 digits
1532-
if (state == 0) {
1532+
if state == 0 {
15331533
if (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c == '+') || (c == '/') || (c == '=') {
15341534
continue
15351535
}
1536-
if (c == '\x1b') {
1536+
if c == '\x1b' {
15371537
state = 1
15381538
continue
15391539
}
1540-
if (c == '\a') {
1540+
if c == '\a' {
15411541
// matched with BEL instead of ST
15421542
b = b[:len(b)-1] // drop the trailing BEL
15431543
decoded := make([]byte, base64.StdEncoding.DecodedLen(len(b)))
@@ -1549,8 +1549,8 @@ func (t *tScreen) parseClipboard(buf *bytes.Buffer, evs *[]Event) (bool, bool) {
15491549
}
15501550
return false, false
15511551
}
1552-
if (state == 1) {
1553-
if (c == '\\') {
1552+
if state == 1 {
1553+
if c == '\\' {
15541554
b = b[:len(b)-2] // drop the trailing ST (\x1b\\)
15551555
// now decode the data
15561556
decoded := make([]byte, base64.StdEncoding.DecodedLen(len(b)))

0 commit comments

Comments
 (0)