Permalink
Browse files

Version 1.00

- tlib#input#List: optimizations- Prepare for multi-mode maps- tlib#input#List: cnfx is new default filter- Filters: minor changes to how the pattern is displayed- g:tlib#input#format_filename: alternative method for formatting filenames- tlib#input#List: allow multiple keymaps / modes- Handle rezise events- Don't initialize the same window twice- Minor optimizations to how help is displayed- Handle VimResize event per buffer- Improve display of filenames & highlighting- Filename highlighter: set Highlight_filename()- RunStateHandlers(): set world variable- Optimize help displayMD5 checksum: e3652927722bdc51935eb1a04238546b
  • Loading branch information...
1 parent 8f2fdc8 commit b0470c1076ba68ac22f7ed07522c3d70b597df53 @tomtom tomtom committed with Sep 28, 2012
@@ -3,8 +3,8 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2008-11-25.
-" @Last Change: 2011-05-18.
-" @Revision: 0.0.84
+" @Last Change: 2012-09-26.
+" @Revision: 0.0.88
let s:prototype = tlib#Object#New({'_class': ['Filter_cnf'], 'name': 'cnf'}) "{{{2
let s:prototype.highlight = g:tlib_inputlist_higroup
@@ -32,10 +32,9 @@ endf
" :nodoc:
function! s:prototype.Help(world) dict "{{{3
- return [a:world.FormatHelp(
- \ printf('"%s", "%s", %sWORD', g:tlib_inputlist_and, g:tlib_inputlist_or, g:tlib_inputlist_not),
+ call a:world.PushHelp(
+ \ printf('%s, %s, %sWORD', g:tlib_inputlist_and, g:tlib_inputlist_or, g:tlib_inputlist_not),
\ 'AND, OR, NOT')
- \ ]
endf
@@ -95,18 +94,22 @@ function! s:prototype.Match(world, text) dict "{{{3
" set smartcase
" endif
" try
+ if !empty(a:world.filter_neg)
for rx in a:world.filter_neg
" TLogVAR rx
if a:text =~ rx
return 0
endif
endfor
+ endif
+ if !empty(a:world.filter_pos)
for rx in a:world.filter_pos
" TLogVAR rx
if a:text !~ rx
return 0
endif
endfor
+ endif
" finally
" let &smartcase = sc
" let &ignorecase = ic
@@ -118,13 +121,14 @@ endf
" :nodoc:
function! s:prototype.DisplayFilter(filter) dict "{{{3
let filter1 = deepcopy(a:filter)
- call map(filter1, '"(". join(reverse(s:Pretty(v:val)), " OR ") .")"')
+ call map(filter1, '"(". join(reverse(self.Pretty(v:val)), " OR ") .")"')
return join(reverse(filter1), ' AND ')
endf
-function! s:Pretty(filter) "{{{3
- call map(a:filter, 'substitute(v:val, ''\\\.\\{-}'', ''__'', ''g'')')
+function! s:prototype.Pretty(filter) dict "{{{3
+ " call map(a:filter, 'substitute(v:val, ''\\\.\\{-}'', ''=>'', ''g'')')
+ call map(a:filter, 'self.CleanFilter(v:val)')
return a:filter
endf
@@ -3,8 +3,8 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2008-11-25.
-" @Last Change: 2011-05-19.
-" @Revision: 0.0.43
+" @Last Change: 2012-09-20.
+" @Revision: 0.0.50
let s:prototype = tlib#Filter_cnf#New({'_class': ['Filter_cnfd'], 'name': 'cnfd'}) "{{{2
let s:prototype.highlight = g:tlib_inputlist_higroup
@@ -28,9 +28,12 @@ let s:Help = s:prototype.Help
" :nodoc:
function! s:prototype.Help(world) dict "{{{3
- let help = call(s:Help, [a:world], self)
- let help += [a:world.FormatHelp('.', 'Any characters')]
- return help
+ call call(s:Help, [a:world], self)
+ if self.name == 'cnfx'
+ call a:world.PushHelp(g:tlib#Filter_cnfx#expander, 'Any characters')
+ else
+ call a:world.PushHelp('.', 'Any characters')
+ endif
endf
@@ -3,8 +3,8 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2008-11-25.
-" @Last Change: 2012-01-30.
-" @Revision: 0.0.44
+" @Last Change: 2012-09-20.
+" @Revision: 0.0.46
let s:prototype = tlib#Filter_cnf#New({'_class': ['Filter_fuzzy'], 'name': 'fuzzy'}) "{{{2
let s:prototype.highlight = g:tlib_inputlist_higroup
@@ -23,7 +23,8 @@ endf
" :nodoc:
function! s:prototype.Init(world) dict "{{{3
" TLogVAR a:world.display_format
- function! a:world.Set_display_format(value) dict "{{{3
+ " :nodoc:
+ function! a:world.Set_display_format(value) dict
if a:value == 'filename'
let self.display_format = ''
else
@@ -37,9 +38,8 @@ let s:Help = s:prototype.Help
" :nodoc:
function! s:prototype.Help(world) dict "{{{3
- let help = call(s:Help, [a:world], self)
- let help += ['Patterns are interpreted as if characters were connected with .\{-}']
- return help
+ call call(s:Help, [a:world], self)
+ call a:world.PushHelp('Patterns are interpreted as if characters were connected with .\{-}')
endf
Oops, something went wrong.

0 comments on commit b0470c1

Please sign in to comment.