mirror of
https://github.com/mawww/kakoune.git
synced 2024-09-11 13:00:41 +03:00
Merge remote-tracking branch 'krobelus/show-completions-eagerly'
This commit is contained in:
commit
f9fe191437
@ -16,16 +16,22 @@ define-command -params ..1 \
|
|||||||
-shell-script-candidates %{
|
-shell-script-candidates %{
|
||||||
realpath() { ( cd "$(dirname "$1")"; printf "%s/%s\n" "$(pwd -P)" "$(basename "$1")" ) }
|
realpath() { ( cd "$(dirname "$1")"; printf "%s/%s\n" "$(pwd -P)" "$(basename "$1")" ) }
|
||||||
eval "set -- $kak_quoted_opt_ctagsfiles"
|
eval "set -- $kak_quoted_opt_ctagsfiles"
|
||||||
for candidate in "$@"; do
|
files=$(
|
||||||
[ -f "$candidate" ] && realpath "$candidate"
|
for candidate in "$@"; do
|
||||||
done | awk '!x[$0]++' | # remove duplicates
|
[ -f "$candidate" ] && realpath "$candidate"
|
||||||
|
done |
|
||||||
|
awk '!x[$0]++; # remove duplicates
|
||||||
|
END { if (length(x) == 1) { exit 1; } }'
|
||||||
|
)
|
||||||
|
[ $? -eq 1 ] && sort=cat || sort=sort
|
||||||
|
printf %s\\n "$files" |
|
||||||
while read -r tags; do
|
while read -r tags; do
|
||||||
namecache="${tags%/*}/.kak.${tags##*/}.namecache"
|
namecache="${tags%/*}/.kak.${tags##*/}.namecache"
|
||||||
if [ -z "$(find "$namecache" -prune -newer "$tags")" ]; then
|
if [ -z "$(find "$namecache" -prune -newer "$tags")" ]; then
|
||||||
cut -f 1 "$tags" | grep -v '^!' | uniq > "$namecache"
|
cut -f 1 "$tags" | grep -v '^!' | uniq > "$namecache"
|
||||||
fi
|
fi
|
||||||
cat "$namecache"
|
cat "$namecache"
|
||||||
done | sort } \
|
done | "$sort" } \
|
||||||
-docstring %{
|
-docstring %{
|
||||||
ctags-search [<symbol>]: jump to a symbol's definition
|
ctags-search [<symbol>]: jump to a symbol's definition
|
||||||
If no symbol is passed then the current selection is used as symbol name
|
If no symbol is passed then the current selection is used as symbol name
|
||||||
|
@ -65,8 +65,7 @@ define-command -params ..1 \
|
|||||||
-shell-script-candidates %{
|
-shell-script-candidates %{
|
||||||
find /usr/share/man/ $(printf %s "${MANPATH}" |
|
find /usr/share/man/ $(printf %s "${MANPATH}" |
|
||||||
sed 's/:/ /') -name '*.[1-8]*' |
|
sed 's/:/ /') -name '*.[1-8]*' |
|
||||||
sed 's,^.*/\(.*\)\.\([1-8][a-zA-Z]*\).*$,\1(\2),' |
|
sed 's,^.*/\(.*\)\.\([1-8][a-zA-Z]*\).*$,\1(\2),'
|
||||||
sort
|
|
||||||
} \
|
} \
|
||||||
-docstring %{
|
-docstring %{
|
||||||
man [<page>]: manpage viewer wrapper
|
man [<page>]: manpage viewer wrapper
|
||||||
|
Loading…
Reference in New Issue
Block a user