mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
run go modernizer
This commit is contained in:
@@ -142,8 +142,8 @@ func bestWordMatch(queryToken string, words []wordToken, colText string) (score
|
||||
|
||||
// Compound token: try exact substring match in the column text
|
||||
colLower := strings.ToLower(colText)
|
||||
if idx := strings.Index(colLower, queryToken); idx != -1 {
|
||||
runeIdx := len([]rune(colLower[:idx]))
|
||||
if before, _, ok := strings.Cut(colLower, queryToken); ok {
|
||||
runeIdx := len([]rune(before))
|
||||
qRuneLen := len([]rune(queryToken))
|
||||
subParts := strings.FieldsFunc(queryToken, isWordDelimiter)
|
||||
return 4 * len(subParts), runeRange(runeIdx, runeIdx+qRuneLen)
|
||||
|
||||
@@ -23,8 +23,8 @@ func testBinding(key, action, help string) Binding {
|
||||
// Action. Action is derived as the first word of actionDisplay.
|
||||
func testMouseBinding(key, actionDisplay string) Binding {
|
||||
action := actionDisplay
|
||||
if idx := strings.IndexByte(actionDisplay, ' '); idx >= 0 {
|
||||
action = actionDisplay[:idx]
|
||||
if before, _, ok := strings.Cut(actionDisplay, " "); ok {
|
||||
action = before
|
||||
}
|
||||
return Binding{
|
||||
Key: key,
|
||||
|
||||
Reference in New Issue
Block a user