1 parent
d19809e8b6
commit
d67054a000
2 files changed
+5
-6
No files matched your search
@@ -1,4 +1,3 @@
|
||||
language: go
|
||||
install:
|
||||
- go get github.com/nsf/termbox-go
|
||||
- go get golang.org/x/text
|
||||
@@ -9,17 +9,17 @@ import (
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
"golang.org/x/text/width"
|
||||
"github.com/mattn/go-runewidth"
|
||||
)
|
||||
|
||||
func isRoot(name string) bool { return filepath.Dir(name) == name }
|
||||
|
||||
func runeWidth(r rune) int {
|
||||
k := width.LookupRune(r).Kind()
|
||||
if k == width.EastAsianFullwidth || k == width.EastAsianWide {
|
||||
return 2
|
||||
w := runewidth.RuneWidth(r)
|
||||
if w == 0 || (w == 2 && runewidth.IsAmbiguousWidth(r)) {
|
||||
w = 1
|
||||
}
|
||||
return 1
|
||||
return w
|
||||
}
|
||||
|
||||
func runeSliceWidth(rs []rune) int {
|
||||
|
||||
Reference in new issue
Block a user