Skip to content
Myr

Fix handling of unicode characters in query string

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 08a6fd4 · Browse files · 1 file+6 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−4 removed

  • other:+6 added−4 removed

1 file+6 added−4 removed

modified:src/terminal.go+6 added-4 removed
403 unmodified lines
404 return util.Min(termHeight, util.Max(maxHeight, effectiveMinHeight))405 }406 renderer = tui.NewLightRenderer(opts.Theme, opts.Black, opts.Mouse, opts.Tabstop, opts.ClearOnExit, false, maxHeightFunc)407 }408 wordRubout := "[^[:alnum:]][[:alnum:]]"409 wordNext := "[[:alnum:]][^[:alnum:]]|(.$)"408 wordRubout := "[^\\pL\\pN][\\pL\\pN]"409 wordNext := "[\\pL\\pN][^\\pL\\pN]|(.$)"410 if opts.FileWord {411 sep := regexp.QuoteMeta(string(os.PathSeparator))412 wordRubout = fmt.Sprintf("%s[^%s]", sep, sep)413 wordNext = fmt.Sprintf("[^%s]%s|(.$)", sep, sep)
817 unmodified lines
1231 locs := rx.FindAllStringIndex(str, -1)1232 if locs == nil {1233 return -11234 }1235 return locs[len(locs)-1][0]1235 prefix := []rune(str[:locs[len(locs)-1][0]])1236 return len(prefix)1237}12381239func findFirstMatch(pattern string, str string) int {1240 rx, err := regexp.Compile(pattern)
3 unmodified lines
1244 loc := rx.FindStringIndex(str)1245 if loc == nil {1246 return -11247 }1247 return loc[0]1248 prefix := []rune(str[:loc[0]])1249 return len(prefix)1250}12511252func copySlice(slice []rune) []rune {1253 ret := make([]rune, len(slice))
1077 unmodified lines