fix :tag when a '<' is present in the search pattern

This commit is contained in:
Maxime Coste 2015-01-30 13:41:14 +00:00
parent 804a050c39
commit 47c8a4378f

View File

@ -18,7 +18,8 @@ def -shell-params \
) | awk -F '\t|\n' -e ' ) | awk -F '\t|\n' -e '
/[^\t]+\t[^\t]+\t\/\^.*\$\// { /[^\t]+\t[^\t]+\t\/\^.*\$\// {
re=$0; sub(".*\t/\\^", "", re); sub("\\$/.*", "", re); gsub("(\\{|\\}).*$", "", re); 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} } }" keys=re; gsub(/</, "<lt>", keys);
out = out " %{" $2 " [" re "]} %{try %{ edit %{" $2 "}; exec %{/\\Q" keys "<ret>vc} } catch %{ echo %{unable to find tag} } }"
} }
/[^\t]+\t[^\t]+\t([0-9]+)/ { out = out " %{" $2 ":" $3 "} %{edit %{" $2 "} %{" $3 "}}" } /[^\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 }' END { print length(out) == 0 ? "echo -color Error no such tag " ENVIRON["tagname"] : "menu -auto-single " out }'