diff --git a/rc/ctags.kak b/rc/ctags.kak index dc7a2fcf..5d340f29 100644 --- a/rc/ctags.kak +++ b/rc/ctags.kak @@ -11,8 +11,8 @@ def -shell-params \ export tagname=${1:-${kak_selection}} readtags ${tagname} | awk -F '\t|\n' -e ' /[^\t]+\t[^\t]+\t\/\^.*\$\// { - gsub("^/\\^", "", $3); gsub("\\$/$", "", $3); gsub("(\\{|\\}).*$", "", $3); - out = out " %{" $2 " [" $3 "]} %{try %{ edit %{" $2 "}; exec %{/\\Q" $3 "vc} } catch %{ echo %{unable to find tag} } }" + re=$0; sub(".*\t/\\^", "", re); sub("\\$/.*", "", re); gsub("(\\{|\\}).*$", "", re); + out = out " %{" $2 " [" re "]} %{try %{ edit %{" $2 "}; exec %{/\\Q" re "vc} } catch %{ echo %{unable to find tag} } }" } /[^\t]+\t[^\t]+\t([0-9]+)/ { out = out " %{" $2 ":" $3 "} %{edit %{" $2 "} %{" $3 "}}" } END { print length(out) == 0 ? "echo -color Error no such tag " ENVIRON["tagname"] : "menu -auto-single " out }'