diff options
| author | Teddy Wing | 2018-04-19 21:59:40 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2018-04-19 21:59:40 +0200 | 
| commit | 624c5ac4281c0cf816c25344ab69a17bfa2ba7c5 (patch) | |
| tree | 346143433a9af86b32068a68b7454854e6562219 | |
| parent | 044835706eb9e4053dc750b4b9403e6e5173006b (diff) | |
| parent | da277858f1da1931ac17cbe9f095ea0541051f88 (diff) | |
| download | vim-tabs-grep-624c5ac4281c0cf816c25344ab69a17bfa2ba7c5.tar.bz2 | |
Merge branch 'use-globs-to-match-files'
| -rw-r--r-- | autoload/tabs_grep.vim | 5 | ||||
| -rw-r--r-- | doc/tabs_grep.txt | 13 | 
2 files changed, 11 insertions, 7 deletions
| diff --git a/autoload/tabs_grep.vim b/autoload/tabs_grep.vim index c307aee..b189433 100644 --- a/autoload/tabs_grep.vim +++ b/autoload/tabs_grep.vim @@ -3,9 +3,12 @@ function! tabs_grep#TabsGrep(search)  	silent tabs  	redir END +	" Slice to get rid of `^$` delimiters +	let pattern = glob2regpat(a:search)[1:-2] +  	let tabs = split(tabs_output, '\n') -	call filter(tabs, function('s:MatchString', [a:search])) +	call filter(tabs, function('s:MatchString', [pattern]))  	let tabs = s:FilterTabPageElements(tabs) diff --git a/doc/tabs_grep.txt b/doc/tabs_grep.txt index 988269e..48c7e5e 100644 --- a/doc/tabs_grep.txt +++ b/doc/tabs_grep.txt @@ -7,18 +7,19 @@ Version: 0.0.1  ==============================================================================  INTRODUCTION                                                       *tabs_grep* -TabsGrep filters the output of |:tabs| using a given search |pattern|. This -makes it easier to find out which tab a file is on. +TabsGrep filters the output of |:tabs| using a given search glob. This makes +it easier to find out which tab a file is on.  ==============================================================================  COMMANDS                                                  *tabs_grep-commands*  						*TabsGrep* -:TabsGrep {pattern} -		Output |:tabs| filtered by {pattern} using |match()|. +:TabsGrep {glob} +		Output |:tabs| filtered by {glob}.  		Example: > -		    :TabsGrep \V.vim -<		This shows a list of tabs and file names containing ".vim". +		    :TabsGrep tabs*vim +<		This shows a list of tabs with file names containing +		"*tabs*vim*".  ==============================================================================  LICENSE                                                    *tabs_grep-license* | 
