Skip to content
Myr

[vim] up/down/left/right options to take boolean values

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

When 1 is given, 50% of the screen width or height will be used as the default size of the pane.

authored by Junegunn Choi · committed by Junegunn Choi · parent daa79a6 · Browse files · 1 file+13 added−7 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+13 added−7 removed

  • other:+13 added−7 removed

1 file+13 added−7 removed

modified:plugin/fzf.vim+13 added-7 removed
128 unmodified lines
129 return s:execute(dict, command, temps)130 endif131endfunction132133function! s:present(dict, ...)134 for key in a:000135 if !empty(get(a:dict, key, ''))136 return 1137 endif138 endfor139 return 0140endfunction141142function! s:fzf_tmux(dict)143 let size = ''144 for o in ['up', 'down', 'left', 'right']136 if has_key(a:dict, o)137 let size = '-'.o[0].a:dict[o]145 if s:present(a:dict, o)146 let size = '-'.o[0].(a:dict[o] == 1 ? '' : a:dict[o])147 endif148 endfor149 return printf('LINES=%d COLUMNS=%d %s %s %s --',150 \ &lines, &columns, s:fzf_tmux, size, (has_key(a:dict, 'source') ? '' : '-'))151endfunction152153function! s:tmux_splittable(dict)145 return has_key(a:dict, 'up') ||146 \ has_key(a:dict, 'down') ||147 \ has_key(a:dict, 'left') ||148 \ has_key(a:dict, 'right')154 return s:present(a:dict, 'up', 'down', 'left', 'right')155endfunction156157function! s:pushd(dict)152 if !empty(get(a:dict, 'dir', ''))158 if s:present(a:dict, 'dir')159 let a:dict.prev_dir = getcwd()160 execute 'chdir '.s:escape(a:dict.dir)161 return 1162 endif
93 unmodified lines