Skip to content
Myr

[vim] Code cleanup

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

authored by Junegunn Choi · committed by Junegunn Choi · parent 57319f8 · Browse files · 2 files+15 added−18 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+15 added−18 removed

  • tests:+6 added−3 removed
  • other:+9 added−15 removed

2 files+15 added−18 removed

modified:plugin/fzf.vim+9 added-15 removed
123 unmodified lines
124 endif125 let split = s:tmux_enabled() && s:tmux_splittable(dict)126 let command = prefix.(split ? s:fzf_tmux(dict) : fzf_exec).' '.optstr.' > '.temps.result127128 try128 if split129 return s:execute_tmux(dict, command, temps)130 else131 return s:execute(dict, command, temps)132 endif129 if split130 return s:execute_tmux(dict, command, temps)131 else132 return s:execute(dict, command, temps)133 endif134 finally135 call s:popd(dict)136 endtry137endfunction138139function! s:present(dict, ...)140 for key in a:000
57 unmodified lines
198 return s:callback(a:dict, a:temps)199 endif200endfunction201198function! s:env_var(name)199 if exists('$'.a:name)200 return a:name . "='". substitute(expand('$'.a:name), "'", "'\\\\''", 'g') . "' "201 else202 return ''203 endif204endfunction205202function! s:execute_tmux(dict, command, temps)203 let command = a:command204 if s:pushd(a:dict)205 " -c '#{pane_current_path}' is only available on tmux 1.9 or above
23 unmodified lines
229 for tf in values(a:temps)230 silent! call delete(tf)231 endfor232237 call s:popd(a:dict)238233 return lines234endfunction235236function! s:cmd(bang, ...) abort
41 unmodified lines
modified:test/fzf.vader+6 added-3 removed
1 unmodified line
2 let g:dir = fnamemodify(g:vader_file, ':p:h')3 Log 'Test directory: ' . g:dir45Execute (fzf#run with dir option):6 let cwd = getcwd()7 let result = fzf#run({ 'options': '--filter=vdr', 'dir': g:dir })8 AssertEqual ['fzf.vader'], result9 AssertEqual getcwd(), cwd1011 let result = sort(fzf#run({ 'options': '--filter e', 'dir': g:dir }))10 AssertEqual ['fzf.vader', 'test_go.rb', 'test_ruby.rb'], result12 AssertEqual ['fzf.vader', 'test_go.rb'], result13 AssertEqual getcwd(), cwd1415Execute (fzf#run with Funcref command):16 let g:ret = []17 function! g:FzfTest(e)18 call add(g:ret, a:e)19 endfunction20 let result = sort(fzf#run({ 'sink': function('g:FzfTest'), 'options': '--filter e', 'dir': g:dir }))18 AssertEqual ['fzf.vader', 'test_go.rb', 'test_ruby.rb'], result19 AssertEqual ['fzf.vader', 'test_go.rb', 'test_ruby.rb'], sort(g:ret)21 AssertEqual ['fzf.vader', 'test_go.rb'], result22 AssertEqual ['fzf.vader', 'test_go.rb'], sort(g:ret)2324Execute (fzf#run with string source):25 let result = sort(fzf#run({ 'source': 'echo hi', 'options': '-f i' }))26 AssertEqual ['hi'], result
14 unmodified lines