vimwiki

Personal wiki for vim
git clone https://github.com/vimwiki/vimwiki.git
Log | Files | Refs | README | LICENSE

commit b61b74d0372ca46365d8c2a4fea6f15da5daaec5
parent c3ba10ca1254a56bf0af5fa8382fcaa14ce2be1e
Author: EinfachToll <istjanichtzufassen@googlemail.de>
Date:   Mon, 29 Jul 2013 10:51:50 +0200

Fix computation of level of items when using Media syntax

Diffstat:
Mautoload/vimwiki/lst.vim | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/autoload/vimwiki/lst.vim b/autoload/vimwiki/lst.vim @@ -126,10 +126,13 @@ endfunction "}}} "Returns: level of the line "0 is the 'highest' level function! s:get_level(lnum) "{{{ + if getline(a:lnum) =~ '^\s*$' + return 0 + endif if VimwikiGet('syntax') != 'media' - let level = getline(a:lnum) !~ '^\s*$' ? indent(a:lnum) : 0 + let level = indent(a:lnum) 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 let level = (indent(a:lnum) == 0) ? 0 : 9999 endif @@ -1325,6 +1328,8 @@ function! vimwiki#lst#get_list_margin() "{{{ endfunction "}}} function! vimwiki#lst#setup_marker_infos() "{{{ + let s:rx_bullet_chars = '['.join(keys(g:vimwiki_bullet_types), '').']\+' + let s:multiple_bullet_chars = [] for i in keys(g:vimwiki_bullet_types) if g:vimwiki_bullet_types[i] == 1