More actions and window organization

This commit is contained in:
Zachary Yedidia
2018-08-28 18:44:52 -04:00
parent 06d596e780
commit 7d87e6db99
11 changed files with 539 additions and 177 deletions

View File

@@ -135,13 +135,8 @@ func FSize(f *os.File) int64 {
// IsWordChar returns whether or not the string is a 'word character'
// If it is a unicode character, then it does not match
// Word characters are defined as [A-Za-z0-9_]
func IsWordChar(str string) bool {
if len(str) > 1 {
// Unicode
return true
}
c := str[0]
return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c == '_')
func IsWordChar(r rune) bool {
return (r >= '0' && r <= '9') || (r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r == '_')
}
// IsWhitespace returns true if the given rune is a space, tab, or newline