Skip to content
Myr

[vim] Disable height calculation when 'preview' is found in the option string

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

Fix #2093 And we'll phase out height specification with `~` prefix.

authored by Junegunn Choi · committed by Junegunn Choi · parent 6dec42a · Browse files · 2 files+5 added−2 removed
This commit

State

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

Diff stats

2 files+5 added−2 removed

  • other:+5 added−2 removed

2 files+5 added−2 removed

modified:plugin/fzf.vim+3 added
627 unmodified lines
628 let srcsz = len(a:dict.source)629 endif630631 let opts = $FZF_DEFAULT_OPTS.' '.s:evaluate_opts(get(a:dict, 'options', ''))632 if opts =~ 'preview'633 return size634 endif635 let margin = match(opts, '--inline-info\|--info[^-]\{-}inline') > match(opts, '--no-inline-info\|--info[^-]\{-}\(default\|hidden\)') ? 1 : 2636 let margin += stridx(opts, '--border') > stridx(opts, '--no-border') ? 2 : 0637 if stridx(opts, '--header') > stridx(opts, '--no-header')638 let margin += len(split(opts, "\n"))
314 unmodified lines
modified:README-VIM.md+2 added-2 removed
126 unmodified lines
127 \ 'ctrl-v': 'vsplit' }128129" Default fzf layout130" - down / up / left / right131let g:fzf_layout = { 'down': '~40%' }131let g:fzf_layout = { 'down': '40%' }132133" You can set up fzf window using a Vim command (Neovim or latest Vim 8 required)134let g:fzf_layout = { 'window': 'enew' }135let g:fzf_layout = { 'window': '-tabnew' }
279 unmodified lines
415When fzf starts in a terminal buffer, the file type of the buffer is set to416`fzf`. So you can set up `FileType fzf` autocmd to customize the settings of417the window.418419For example, if you use the default layout (`{'down': '~40%'}`) on Neovim, you419For example, if you use the default layout (`{'down': '40%'}`) on Neovim, you420might want to temporarily disable the statusline for a cleaner look.421422```vim423if has('nvim') && !exists('g:fzf_layout')
12 unmodified lines