diff options
author | Teddy Wing | 2018-04-07 15:12:40 +0200 |
---|---|---|
committer | Teddy Wing | 2018-04-07 15:12:40 +0200 |
commit | a4dc3a953586e70d12a401385f3ce516d2d27d37 (patch) | |
tree | 20254aff21696dba045648fd490c47347e594a9b /plugin | |
parent | 0bb9462f0d608a736307bf3233f65f964d721d47 (diff) | |
download | vim-tabs-grep-a4dc3a953586e70d12a401385f3ce516d2d27d37.tar.bz2 |
tabs_grep.vim: Trouble with line continuations; reorder arguments
`s:MatchString()` needs to have the search string as its first argument,
because that's how it will get passed in when referenced above as:
call filter(tabs, function('s:MatchString', [a:search]))
Also had some trouble getting the line continuation to work on the
`return`, so had a few experiments messing with that trying to get it to
work.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/tabs_grep.vim | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/plugin/tabs_grep.vim b/plugin/tabs_grep.vim index 35a00fa..f7ce1b2 100644 --- a/plugin/tabs_grep.vim +++ b/plugin/tabs_grep.vim @@ -20,9 +20,22 @@ function! TabsGrep(search) " echo filtered_tabs endfunction -function! s:MatchString(index, value, search) - return match(a:value, a:search) != -1 || - \ match(a:value, '\vTab page \d+') != -1 +function! s:MatchString(search, index, value) + " let matched = match(a:value, a:search) != -1 || + " \ match(a:value, '\vTab page \d+') != -1 + " let matched = 0 + " \ || 1 + " return matched + " return ( + " \ + " \ match(a:value, '\vTab page \d+') != -1 + " \ ) + " return match(a:value, a:search) != -1 || + " \ match(a:value, '\vTab page \d+') != -1 + echo 'test' + echo a:search + return 0 || + \ 1 endfunction command! -nargs=1 TabsGrep :call TabsGrep(<f-args>) |