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:
@ -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 "}}}
|
||||
|
Reference in New Issue
Block a user