aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-04-07 15:12:40 +0200
committerTeddy Wing2018-04-07 15:12:40 +0200
commita4dc3a953586e70d12a401385f3ce516d2d27d37 (patch)
tree20254aff21696dba045648fd490c47347e594a9b
parent0bb9462f0d608a736307bf3233f65f964d721d47 (diff)
downloadvim-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.
-rw-r--r--plugin/tabs_grep.vim19
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>)