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:
@@ -136,17 +136,17 @@ define-command -override git-hide-diff %{
|
||||
|
||||
define-command -override ctags-file-symbols %{
|
||||
prompt -menu -shell-script-candidates %{
|
||||
ctags -uo - -x "$kak_buffile" | awk '{ print $1, $2, $3 }'
|
||||
ctags -uo - -x "$kak_buffile" | awk -f "$kak_config/scripts/filesymbols.awk"
|
||||
} 'File symbols: ' %{
|
||||
evaluate-commands %sh{ printf '%s\n' "$kak_text" | awk '{ print "execute-keys", $3, "g", "/\\b" $1 "\\b<ret>" }' }
|
||||
evaluate-commands %sh{ awk -f "$kak_config/scripts/filesymbolscmd.awk" # "$kak_text" }
|
||||
}
|
||||
}
|
||||
|
||||
define-command -override ctags-project-symbols %{
|
||||
prompt -menu -shell-script-candidates %{
|
||||
git ls-files | xargs wc | awk '$1 > 0 && $3/$1 < 1024 { print $4 }' | xargs ctags -uo - -x | awk '{ print $1, $2, $3, $4 }'
|
||||
git ls-files | xargs wc | awk '$1 > 0 && $3/$1 < 1024 { print $4 }' | xargs ctags -uo - -x | awk -f "$kak_config/scripts/projectsymbols.awk"
|
||||
} 'Project symbols: ' %{
|
||||
evaluate-commands %sh{ printf '%s\n' "$kak_text" | awk '{ print "edit --", $4, $3 "; execute-keys /\\b" $1 "\\b<ret>" }' }
|
||||
evaluate-commands %sh{ awk -f "$kak_config/scripts/projectsymbolscmd.awk" # "$kak_text" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user