Fix computation of level of items when using Media syntax
This commit is contained in:
@ -126,10 +126,13 @@ endfunction "}}}
|
|||||||
"Returns: level of the line
|
"Returns: level of the line
|
||||||
"0 is the 'highest' level
|
"0 is the 'highest' level
|
||||||
function! s:get_level(lnum) "{{{
|
function! s:get_level(lnum) "{{{
|
||||||
|
if getline(a:lnum) =~ '^\s*$'
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
if VimwikiGet('syntax') != 'media'
|
if VimwikiGet('syntax') != 'media'
|
||||||
let level = getline(a:lnum) !~ '^\s*$' ? indent(a:lnum) : 0
|
let level = indent(a:lnum)
|
||||||
else
|
else
|
||||||
let level = vimwiki#u#count_first_sym(a:lnum) - 1
|
let level = s:string_length(matchstr(getline(a:lnum), s:rx_bullet_chars)) - 1
|
||||||
if level < 0
|
if level < 0
|
||||||
let level = (indent(a:lnum) == 0) ? 0 : 9999
|
let level = (indent(a:lnum) == 0) ? 0 : 9999
|
||||||
endif
|
endif
|
||||||
@ -1325,6 +1328,8 @@ function! vimwiki#lst#get_list_margin() "{{{
|
|||||||
if VimwikiGet('list_margin') < 0
|
if VimwikiGet('list_margin') < 0
|
||||||
return &sw
|
return &sw
|
||||||
else
|
else
|
||||||
|
return VimwikiGet('list_margin')
|
||||||
|
endif
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
function! vimwiki#lst#setup_marker_infos() "{{{
|
function! vimwiki#lst#setup_marker_infos() "{{{
|
||||||
|
Reference in New Issue
Block a user