Add text objects for list items

I put the function in lst.vim, not base.vim because it uses some
functions from lst.vim and because it's list stuff.
This commit is contained in:
EinfachToll
2013-10-30 10:53:34 +01:00
parent e9b1b66807
commit 140d32fcdd
3 changed files with 28 additions and 1 deletions

View File

@ -1410,6 +1410,24 @@ function! vimwiki#lst#setup_marker_infos() "{{{
else
"regex that matches nothing
let g:vimwiki_rxListNumber = '$^'
endif
endfunction "}}}
function! vimwiki#lst#TO_list_item(inner, visual) "{{{
let lnum = prevnonblank('.')
let item = s:get_corresponding_item(lnum)
if item.type == 0
return
endif
let from_line = item.lnum
if a:inner
let to_line = s:get_last_line_of_item(item)
else
let to_line = s:get_last_line_of_item_incl_children(item)
endif
normal! V
call cursor(to_line, 0)
normal! o
call cursor(from_line, 0)
endfunction "}}}