kakoune: file and project symbols: support spaces in first token (example css)
uses non-breaking space as a separator and assumes that first numeric token (starting from second one) is the line number (i.e., assumes that the searched token does not contain space delimited number)
This commit is contained in:
11
kakoune/.config/kak/scripts/projectsymbolscmd.awk
Normal file
11
kakoune/.config/kak/scripts/projectsymbolscmd.awk
Normal file
@@ -0,0 +1,11 @@
|
||||
BEGIN {
|
||||
n = split(ENVIRON["kak_text"], a, "\u00a0")
|
||||
line = a[3]
|
||||
if (n == 4 && line ~ /^[0-9]+/) {
|
||||
pat = a[1]
|
||||
gsub(/'/, "''", pat)
|
||||
gsub(/\\/, "\\\\", pat)
|
||||
print "edit --", a[4], line
|
||||
print "execute-keys vv x s %{/\\b\\Q" pat "\\E\\b|\\Q" pat "<ret>} <a-)>,"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user