From 9931e0888b2419326ae10ebbfae532261c5c125f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 30 Jun 2016 16:11:56 +0200 Subject: Fix submodules --- vim/bundle/tlib_vim | 1 + .../samples/tlib/input/tlib_input_list.vim | 50 ---------------------- 2 files changed, 1 insertion(+), 50 deletions(-) create mode 160000 vim/bundle/tlib_vim delete mode 100644 vim/bundle/tlib_vim/samples/tlib/input/tlib_input_list.vim (limited to 'vim/bundle/tlib_vim/samples') diff --git a/vim/bundle/tlib_vim b/vim/bundle/tlib_vim new file mode 160000 index 0000000..5636472 --- /dev/null +++ b/vim/bundle/tlib_vim @@ -0,0 +1 @@ +Subproject commit 5636472e5dba1a4104376ce6bd93cc2546e02483 diff --git a/vim/bundle/tlib_vim/samples/tlib/input/tlib_input_list.vim b/vim/bundle/tlib_vim/samples/tlib/input/tlib_input_list.vim deleted file mode 100644 index 4d668ff..0000000 --- a/vim/bundle/tlib_vim/samples/tlib/input/tlib_input_list.vim +++ /dev/null @@ -1,50 +0,0 @@ -" The following variable configures the way |tlib#input#ListD()| works. -" In this example, we allow selection of multiple items (we could also -" allow only a single choice and make |tlib#input#ListD()| work on the -" indices, not the items). -" -" We also set a prompt that will be displayed in the command area. -" -" By default, |tlib#input#ListD()| will automatically select an item if -" there is only one item left matching the filter. In this example, we -" disable this feature. -" -" For demonstration purposes, we also define a key handler that prints -" the selected items. -let s:state = { - \ 'type': 'm', - \ 'query': 'Select lines for command output', - \ 'pick_last_item': 0, - \ 'key_handlers': [ - \ {'key': 16, 'agent': 'PrintMe', 'key_name': '', 'help': 'Print line'}, - \ ], - \ } - -" A key handler takes two arguments: the current state of the list -" display and a list of selected items/indices (depending on the type -" parameter). -function! PrintMe(state, items) "{{{3 - echom "You selected:" - for i in a:items - echom i - endfor - call input("Press ENTER to continue") - let a:state.state = 'redisplay' - return a:state -endf - -" In this example, we evaluate an ex-command with |:execute| and display -" the command's output as list. The user can select certain lines by -" typing some pattern or by pressing to select an item by -" number. The user can then press to print the lines (see above) -" or to pick the selected lines. -function! SelectOutput(ex) "{{{3 - redir => lines - silent exec a:ex - redir END - let state = copy(s:state) - let state.base = split(lines, '\n') - let picked = tlib#input#ListD(state) - echom "You picked: ". join(picked, ', ') -endf - -- cgit v1.2.3