mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-02 05:02:04 -07:00
Add --height option
This commit is contained in:
@@ -6,8 +6,24 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/junegunn/go-isatty"
|
||||
"github.com/junegunn/go-runewidth"
|
||||
)
|
||||
|
||||
var _runeWidths = make(map[rune]int)
|
||||
|
||||
// RuneWidth returns rune width
|
||||
func RuneWidth(r rune, prefixWidth int, tabstop int) int {
|
||||
if r == '\t' {
|
||||
return tabstop - prefixWidth%tabstop
|
||||
} else if w, found := _runeWidths[r]; found {
|
||||
return w
|
||||
} else {
|
||||
w := runewidth.RuneWidth(r)
|
||||
_runeWidths[r] = w
|
||||
return w
|
||||
}
|
||||
}
|
||||
|
||||
// Max returns the largest integer
|
||||
func Max(first int, second int) int {
|
||||
if first >= second {
|
||||
|
Reference in New Issue
Block a user