Don't insert marker character with o or O within a code block.

Previously if a code block was part of a list and o or O was used a new
list marker would be inserted. Also moved the is_codeblock check
function to utils file for use elsewhere.
This commit is contained in:
Rane Brown
2019-10-16 22:27:26 -06:00
parent 1f85a3c855
commit a42cd58636
2 changed files with 23 additions and 18 deletions

View File

@ -93,3 +93,13 @@ function vimwiki#u#map_key(mode, key, plug, ...)
endif
endif
endfunction
function! vimwiki#u#is_codeblock(lnum)
let syn_g = synIDattr(synID(a:lnum,1,1),'name')
if syn_g =~# 'textSnip.*' || syn_g =~# 'VimwikiPre.*' || syn_g =~# '.*Comment'
return 1
else
return 0
endif
endfunction