Add tabmovement support

This commit is contained in:
Zachary Yedidia
2019-06-15 16:03:02 -04:00
parent adfeaf52ba
commit 995e1dc704
2 changed files with 44 additions and 9 deletions

View File

@@ -239,11 +239,10 @@ func IsWhitespace(c rune) bool {
return c == ' ' || c == '\t' || c == '\n'
}
// IsStrWhitespace returns true if the given string is all whitespace
func IsStrWhitespace(str string) bool {
// Range loop for unicode correctness
for _, c := range str {
if !IsWhitespace(c) {
// IsBytesWhitespace returns true if the given bytes are all whitespace
func IsBytesWhitespace(b []byte) bool {
for _, c := range b {
if !IsWhitespace(rune(c)) {
return false
}
}