mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
Implement limits for __history_completions in j completions
This commit is contained in:
parent
f18b6868b7
commit
2dd2867a61
1 changed files with 7 additions and 3 deletions
|
@ -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)
|
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
|
end
|
||||||
|
|
||||||
complete -k -c j -a '(__history_completions)' -f
|
complete -k -c j -a '(__history_completions 25)' -f
|
||||||
|
|
Loading…
Reference in a new issue