From bb5b4af6e7f53d397620281215d866caf8923cee Mon Sep 17 00:00:00 2001 From: chzyer <0@0xdf.com> Date: Fri, 25 Mar 2016 17:07:55 +0800 Subject: [PATCH] fix wordbreak to add number --- utils.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/utils.go b/utils.go index de228a9..468ab9b 100644 --- a/utils.go +++ b/utils.go @@ -137,13 +137,14 @@ func LineCount(screenWidth, w int) int { } func IsWordBreak(i rune) bool { - if i >= 'a' && i <= 'z' { - return false + switch { + case i >= 'a' && i <= 'z': + case i >= 'A' && i <= 'Z': + case i >= '0' && i <= '9': + default: + return true } - if i >= 'A' && i <= 'Z' { - return false - } - return true + return false } func GetInt(s []string, def int) int {