mirror of
https://github.com/junegunn/fzf.git
synced 2026-10-26 20:16:32 +00:00
fish: Optimize description alignment of completions (#4912)
Close #4910
This commit is contained in:
1 parent
ad151d8415
commit
a1e983baf1
2 files changed
+5
-5
No files matched your search
@@ -124,10 +124,8 @@ function fzf_complete -w fzf -d 'fzf command completion and wildcard expansion s
|
||||
|
||||
# Determine the tabstop length for description alignment
|
||||
set -l -- max_columns (math $COLUMNS - 40)
|
||||
for i in $list[1..500]
|
||||
set -l -- item (string split -f 1 -- \t $i)
|
||||
and set -l -- len (string length -V -- $item)
|
||||
and test "$len" -gt "$tabstop" -a "$len" -lt "$max_columns"
|
||||
for len in (string match -r -- '^[^\\t]*(?=\\t)' $list[1..500] | string length -V)
|
||||
test "$len" -gt "$tabstop" -a "$len" -lt "$max_columns"
|
||||
and set -- tabstop $len
|
||||
end
|
||||
set -- tabstop (math $tabstop + 4)
|
||||
|
||||
Reference in new issue
Block a user