diff --git a/share/completions/j.fish b/share/completions/j.fish index 04c45411d..7d8a995aa 100644 --- a/share/completions/j.fish +++ b/share/completions/j.fish @@ -1,6 +1,10 @@ -function __history_completions +function __history_completions --argument limit + if echo $limit | string match -q "" + set limit 25 + end + set -l tokens (commandline --current-process --tokenize) - history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" + history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" | head -n$limit end -complete -k -c j -a '(__history_completions)' -f +complete -k -c j -a '(__history_completions 25)' -f