mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-22 21:05:09 +00:00
parent
a47c06cb61
commit
71a7b3a26f
@ -62,6 +62,7 @@ func (a ByTimeOrder) Less(i, j int) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var _spinner = []string{`-`, `\`, `|`, `/`, `-`, `\`, `|`, `/`}
|
var _spinner = []string{`-`, `\`, `|`, `/`, `-`, `\`, `|`, `/`}
|
||||||
|
var _runeWidths = make(map[rune]int)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
reqPrompt util.EventType = iota
|
reqPrompt util.EventType = iota
|
||||||
@ -176,8 +177,12 @@ func (t *Terminal) output() {
|
|||||||
func runeWidth(r rune, prefixWidth int) int {
|
func runeWidth(r rune, prefixWidth int) int {
|
||||||
if r == '\t' {
|
if r == '\t' {
|
||||||
return 8 - prefixWidth%8
|
return 8 - prefixWidth%8
|
||||||
|
} else if w, found := _runeWidths[r]; found {
|
||||||
|
return w
|
||||||
} else {
|
} else {
|
||||||
return runewidth.RuneWidth(r)
|
w := runewidth.RuneWidth(r)
|
||||||
|
_runeWidths[r] = w
|
||||||
|
return w
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user