From 335e80b618f5fd7667c12ec3c0da8baa39430e3f Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 7 Apr 2018 15:15:33 +0200 Subject: s:MatchString(): Fix line continuation problem I had had trouble with the line continuation in this function, but it turns out what I had written the first time was fine. It's just that I was sourcing my plugin incorrectly and that's the reason why I was getting errors. Before I was doing: $ vim --cmd 'so ~/Documents/Development/vim-tabs-grep/plugin/tabs_grep.vim' -p bin/imagebin.ca.sh bin/fucking-orange.sh functions/frequency w3m-tabs.exp Using the `-c` flag instead completely fixed the problem: $ vim -c 'so ~/Documents/Development/vim-tabs-grep/plugin/tabs_grep.vim' -p bin/imagebin.ca.sh bin/fucking-orange.sh functions/frequency w3m-tabs.exp Revert back to the original code in this function. --- plugin/tabs_grep.vim | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/plugin/tabs_grep.vim b/plugin/tabs_grep.vim index f7ce1b2..8b98f1b 100644 --- a/plugin/tabs_grep.vim +++ b/plugin/tabs_grep.vim @@ -21,21 +21,8 @@ function! TabsGrep(search) endfunction 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 + return match(a:value, a:search) != -1 || + \ match(a:value, '\vTab page \d+') != -1 endfunction command! -nargs=1 TabsGrep :call TabsGrep() -- cgit v1.2.3