From 409be4731f5820cea1fa34f2c03b23380e558fb9 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 7 Apr 2014 19:06:09 +0100 Subject: [PATCH] ctags.kak: fix support for tags with a tab character in search line --- rc/ctags.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 }'