mirror of
https://github.com/junegunn/fzf.git
synced 2024-08-17 10:20:26 +03:00
Avoid printing ANSI reset codes
fzf --border --bind 'start:transform-border-label:echo -e "\x1b[0mfoo"'
This commit is contained in:
parent
2faffbd1b7
commit
cfc149e994
@ -1006,8 +1006,8 @@ func (t *Terminal) ansiLabelPrinter(str string, color *tui.ColorPair, fill bool)
|
|||||||
runes := []rune(text)
|
runes := []rune(text)
|
||||||
|
|
||||||
// Simpler printer for strings without ANSI colors or tab characters
|
// Simpler printer for strings without ANSI colors or tab characters
|
||||||
if colors == nil && !strings.ContainsRune(str, '\t') {
|
if colors == nil && !strings.ContainsRune(text, '\t') {
|
||||||
length := util.StringWidth(str)
|
length := util.StringWidth(text)
|
||||||
if length == 0 {
|
if length == 0 {
|
||||||
return nil, 0
|
return nil, 0
|
||||||
}
|
}
|
||||||
@ -1016,9 +1016,9 @@ func (t *Terminal) ansiLabelPrinter(str string, color *tui.ColorPair, fill bool)
|
|||||||
trimmedRunes, _ := t.trimRight(runes, limit)
|
trimmedRunes, _ := t.trimRight(runes, limit)
|
||||||
window.CPrint(*color, string(trimmedRunes))
|
window.CPrint(*color, string(trimmedRunes))
|
||||||
} else if fill {
|
} else if fill {
|
||||||
window.CPrint(*color, util.RepeatToFill(str, length, limit))
|
window.CPrint(*color, util.RepeatToFill(text, length, limit))
|
||||||
} else {
|
} else {
|
||||||
window.CPrint(*color, str)
|
window.CPrint(*color, text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return printFn, length
|
return printFn, length
|
||||||
|
Loading…
Reference in New Issue
Block a user