ctags.kak: fix support for tags with a tab character in search line

This commit is contained in:
Maxime Coste 2014-04-07 19:06:09 +01:00
parent 0df088be20
commit 409be4731f

View File

@ -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 "<ret>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 "<ret>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 }'