Skip to content

Commit

Permalink
Let max-lines default to 16
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonrichert committed May 20, 2024
1 parent 88bc03c commit adfade3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Completions/_autocomplete__history_lines
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ _autocomplete__history_lines() {

local -Pi excess= index= max= list_lines=
if (( is_incremental )); then
.autocomplete:async:list-choices:max-lines 16
.autocomplete:async:list-choices:max-lines
(( list_lines = _autocomplete__max_lines ))
(( max = 16 * list_lines )) # Buffer for bubbling up more relevant results.
else
Expand Down
2 changes: 1 addition & 1 deletion Completions/_autocomplete__recent_paths
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local -P singular plural tag

ret=1

.autocomplete:async:list-choices:max-lines 16
.autocomplete:async:list-choices:max-lines

for singular plural in directory directories file files; do
if [[ -v functions[+autocomplete:recent-$plural] ]] &&
Expand Down
6 changes: 3 additions & 3 deletions Functions/Init/.autocomplete__async
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,9 @@ ${0}:precmd() {
} 2>>| $_autocomplete__log

.autocomplete:async:list-choices:max-lines() {
local -Pi max_lines=0
local -Pi max_lines
builtin zstyle -s ":autocomplete:${curcontext}:" list-lines max_lines ||
max_lines=$1
max_lines=16
_autocomplete__max_lines=$(( min( max_lines, LINES - BUFFERLINES - 1 ) ))
}

Expand Down Expand Up @@ -433,7 +433,7 @@ ${0}:precmd() {
# functions -T compadd _describe
} "$@"

.autocomplete:async:list-choices:max-lines 16
.autocomplete:async:list-choices:max-lines
autocomplete:_main_complete:new "$@"
} always {
unfunction compadd comptags 2> /dev/null
Expand Down

0 comments on commit adfade3

Please sign in to comment.