Skip to content
Myr

[vim] Only prepend --border option in $FZF_DEFAULT_OPTS

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix #3318

authored by Junegunn Choi · committed by Junegunn Choi · parent 2034019 · Browse files · 1 file+25 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+25 added−1 removed

  • other:+25 added−1 removed

1 file+25 added−1 removed

modified:plugin/fzf.vim+25 added-1 removed
454 unmodified lines
455 throw 'Failed to write temporary file. Check if you can write to the path tempname() returns.'456 endif457endfunction458459function! s:extract_option(opts, name)460 let opt = ''461 let expect = 0462 " There are a few cases where this function doesn't work as expected.463 " Let's just assume such cases are extremely unlikely in real world.464 " e.g. --query --border465 for word in split(a:opts)466 if expect && word !~ '^"\=-'467 let opt = opt . ' ' . word468 let expect = 0469 elseif word == '--no-'.a:name470 let opt = ''471 elseif word =~ '^--'.a:name.'='472 let opt = word473 elseif word =~ '^--'.a:name.'$'474 let opt = word475 let expect = 1476 elseif expect477 let expect = 0478 endif479 endfor480 return opt481endfunction482483function! fzf#run(...) abort484try485 let [shell, shellslash, shellcmdflag, shellxquote] = s:use_sh()486
48 unmodified lines
535 let height = s:calc_size(&lines, dict.down, dict)536 let optstr .= ' --height='.height537 endif538 " Respect --border option given in $FZF_DEFAULT_OPTS and 'options'515 let optstr = join([s:border_opt(get(dict, 'window', 0)), $FZF_DEFAULT_OPTS, optstr])539 let optstr = join([s:border_opt(get(dict, 'window', 0)), s:extract_option($FZF_DEFAULT_OPTS, 'border'), optstr])540 let prev_default_command = $FZF_DEFAULT_COMMAND541 if len(source_command)542 let $FZF_DEFAULT_COMMAND = source_command543 endif
555 unmodified lines