From 7a2afbcf489c40c1f7aa6a331dcd4ce11d0cfbcc Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 12 Oct 2014 18:51:27 +0100 Subject: [PATCH] Add support for a ctagsfiles option that lists all tags to read from Results from all tags will be merged Fixes #22 --- rc/ctags.kak | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rc/ctags.kak b/rc/ctags.kak index 8d9d96cd..4d84aad7 100644 --- a/rc/ctags.kak +++ b/rc/ctags.kak @@ -3,13 +3,20 @@ # This script requires the readtags command available in ctags source but # not installed by default +decl str-list ctagsfiles 'tags' + def -shell-params \ -shell-completion 'readtags -p "$1" | cut -f 1 | sort | uniq' \ -docstring 'jump to tag definition' \ tag \ %{ %sh{ export tagname=${1:-${kak_selection}} - readtags ${tagname} | awk -F '\t|\n' -e ' + ( + IFS=':' + for tags in ${kak_opt_ctagsfiles}; do + readtags -t "${tags}" ${tagname} + done + ) | awk -F '\t|\n' -e ' /[^\t]+\t[^\t]+\t\/\^.*\$\// { 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} } }"