mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-23 23:28:31 +00:00
Fix bind spec parser
This commit is contained in:
parent
73162a4bc3
commit
8e283f512a
@ -938,7 +938,11 @@ Loop:
|
||||
break
|
||||
}
|
||||
// Keep + or , at the end
|
||||
masked += strings.Repeat(" ", loc[1]-1) + action[loc[1]-1:loc[1]]
|
||||
lastChar := action[loc[1]-1]
|
||||
if lastChar == '+' || lastChar == ',' {
|
||||
loc[1]--
|
||||
}
|
||||
masked += strings.Repeat(" ", loc[1])
|
||||
action = action[loc[1]:]
|
||||
}
|
||||
masked = strings.Replace(masked, "::", string([]rune{escapedColon, ':'}), -1)
|
||||
|
@ -499,3 +499,12 @@ func TestParseSingleActionListError(t *testing.T) {
|
||||
t.Errorf("Failed to detect error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestMaskActionContents(t *testing.T) {
|
||||
original := ":execute((f)(o)(o)(b)(a)(r))+change-query@qu@ry@+up,x:reload:hello:world"
|
||||
expected := ":execute +change-query +up,x:reload "
|
||||
masked := maskActionContents(original)
|
||||
if masked != expected {
|
||||
t.Errorf("Not masked: %s", masked)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user