Permalink
Browse files

Version 0.35: tlib#input#EditList(): return the list if the user pres…

…ses esc
  • Loading branch information...
1 parent 8386fa8 commit afbf493ff576d4c2565924494ad97a431c29e0e5 @tomtom tomtom committed with Dec 21, 2009
Showing with 23 additions and 15 deletions.
  1. +11 −6 autoload/tlib/input.vim
  2. +6 −6 doc/tlib.txt
  3. +6 −3 plugin/02tlib.vim
View
@@ -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: 2007-06-30.
-" @Last Change: 2009-08-23.
-" @Revision: 0.0.648
+" @Last Change: 2009-12-16.
+" @Revision: 0.0.654
if &cp || exists("loaded_tlib_input_autoload")
finish
@@ -553,12 +553,17 @@ endf
" EXAMPLES: >
" echo tlib#input#EditList('Edit:', [100,200,300])
function! tlib#input#EditList(query, list, ...) "{{{3
- let handlers = a:0 >= 1 ? a:1 : g:tlib_handlers_EditList
- let rv = a:0 >= 2 ? a:2 : ''
+ let handlers = a:0 >= 1 && !empty(a:1) ? a:1 : g:tlib_handlers_EditList
+ let default = a:0 >= 2 ? a:2 : ''
let timeout = a:0 >= 3 ? a:3 : 0
" TLogVAR handlers
- let [success, list] = tlib#input#List('m', a:query, copy(a:list), handlers, rv, timeout)
- return success ? list : a:list
+ let rv = tlib#input#List('m', a:query, copy(a:list), handlers, default, timeout)
+ if empty(rv)
+ return a:list
+ else
+ let [success, list] = rv
+ return success ? list : a:list
+ endif
endf
View
@@ -487,7 +487,7 @@ tlib#Object#New(?fields={})
echo "I think, therefore I am ". (self.foo * self.bar) ." months old."
}
-< This could now be used like this: >
+< This could now be used like this: >
let myfoo = FooBar({'foo': 3})
call myfoo.babble()
=> I think, therefore I am 6 months old.
@@ -591,7 +591,7 @@ tlib#agent#Suspend(world, selected)
|tlib#input#List|. You can resume editing the list by pressing <c-z>,
<m-z>. <space>, <c-LeftMouse> or <MiddleMouse> in the suspended window.
<cr> and <LeftMouse> will immediatly select the item under the cursor.
-< will select the item but the window will remain opened.
+< will select the item but the window will remain opened.
*tlib#agent#Help()*
tlib#agent#Help(world, selected)
@@ -1309,14 +1309,14 @@ tlib#tag#Retrieve(rx, ?extra_tags=0)
ctags -R --fields=+iaSm --extra=+q ${JAVA_HOME}/src
head -n 6 tags > tags0
grep access:public tags >> tags0
-< 2. Say 'tags' included project specific tags files. In
+< 2. Say 'tags' included project specific tags files. In
~/vimfiles/after/ftplugin/java.vim insert: >
let b:tlib_tags_extra = $JAVA_HOME .'/tags0'
-< 3. When this function is invoked as >
+< 3. When this function is invoked as >
echo tlib#tag#Retrieve('print')
-< It will return only project-local tags. If it is invoked as >
+< It will return only project-local tags. If it is invoked as >
echo tlib#tag#Retrieve('print', 1)
-< tags from the JDK will be included.
+< tags from the JDK will be included.
*tlib#tag#Collect()*
tlib#tag#Collect(constraints, ?use_extra=1, ?match_front=1)
View
@@ -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: 2007-04-10.
-" @Last Change: 2009-12-07.
-" @Revision: 588
+" @Last Change: 2009-12-21.
+" @Revision: 592
" GetLatestVimScripts: 1863 1 tlib.vim
"
" Please see also ../test/tlib.vim for usage examples.
@@ -29,7 +29,7 @@ if v:version < 700 "{{{2
echoerr "tlib requires Vim >= 7"
finish
endif
-let loaded_tlib = 34
+let loaded_tlib = 35
let s:save_cpo = &cpo
set cpo&vim
@@ -560,3 +560,6 @@ pressing <esc> when browsing an index-list, returns 0 and not "")
- tlib#buffer#HighlightLine(line): call tlib#autocmdgroup#Init()
(reported by Sergey Khorev)
+0.35
+- tlib#input#EditList(): return the list if the user presses esc
+

0 comments on commit afbf493

Please sign in to comment.