g:vimwiki_listsyms is a string again, not a list
this is to be backwards compatible we still need to split it into a list internally, because indexing doesn't work for unicode symbols
This commit is contained in:
parent
96dfabb03b
commit
9810ff1c55
@ -694,7 +694,7 @@ function! s:get_rate(item) "{{{
|
||||
return -1
|
||||
endif
|
||||
let state = a:item.cb
|
||||
return index(g:vimwiki_listsyms, state) * 25
|
||||
return index(g:vimwiki_listsyms_list, state) * 25
|
||||
endfunction "}}}
|
||||
|
||||
"Set state of the list item to [ ] or [o] or whatever
|
||||
@ -731,15 +731,15 @@ endfunction "}}}
|
||||
function! s:rate_to_state(rate) "{{{
|
||||
let state = ''
|
||||
if a:rate == 100
|
||||
let state = g:vimwiki_listsyms[4]
|
||||
let state = g:vimwiki_listsyms_list[4]
|
||||
elseif a:rate == 0
|
||||
let state = g:vimwiki_listsyms[0]
|
||||
let state = g:vimwiki_listsyms_list[0]
|
||||
elseif a:rate >= 67
|
||||
let state = g:vimwiki_listsyms[3]
|
||||
let state = g:vimwiki_listsyms_list[3]
|
||||
elseif a:rate >= 34
|
||||
let state = g:vimwiki_listsyms[2]
|
||||
let state = g:vimwiki_listsyms_list[2]
|
||||
else
|
||||
let state = g:vimwiki_listsyms[1]
|
||||
let state = g:vimwiki_listsyms_list[1]
|
||||
endif
|
||||
return state
|
||||
endfunction "}}}
|
||||
@ -793,7 +793,7 @@ function! s:create_cb(item) "{{{
|
||||
endif
|
||||
|
||||
let new_item = a:item
|
||||
let new_item.cb = g:vimwiki_listsyms[0]
|
||||
let new_item.cb = g:vimwiki_listsyms_list[0]
|
||||
call s:substitute_rx_in_line(new_item.lnum,
|
||||
\ vimwiki#u#escape(new_item.mrkr) . '\zs\ze', ' [' . new_item.cb . ']')
|
||||
|
||||
@ -1493,6 +1493,8 @@ function! vimwiki#lst#setup_marker_infos() "{{{
|
||||
let g:vimwiki_rxListNumber = '$^'
|
||||
endif
|
||||
|
||||
"the user can set the listsyms as string, but vimwiki needs a list
|
||||
let g:vimwiki_listsyms_list = split(g:vimwiki_listsyms, '\zs')
|
||||
endfunction "}}}
|
||||
|
||||
function! vimwiki#lst#TO_list_item(inner, visual) "{{{
|
||||
|
@ -1879,15 +1879,15 @@ Default: 'Vimwiki'
|
||||
------------------------------------------------------------------------------
|
||||
*g:vimwiki_listsyms*
|
||||
|
||||
List of 5 symbols for list items with checkboxes.
|
||||
Default value is [' ', '.', 'o', 'O', 'X'].
|
||||
String of 5 symbols for list items with checkboxes.
|
||||
Default value is ' .oOX'.
|
||||
|
||||
g:vimwiki_listsyms[0] is for 0% done items.
|
||||
g:vimwiki_listsyms[4] is for 100% done items.
|
||||
The first char is for 0% done items.
|
||||
The fifth is for 100% done items.
|
||||
|
||||
You can set it to some more fancy symbols like this:
|
||||
|
||||
let g:vimwiki_listsyms = ['✗', '○', '◐', '●', '✓']
|
||||
>
|
||||
let g:vimwiki_listsyms = '✗○◐●✓'
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*g:vimwiki_use_mouse*
|
||||
|
@ -392,7 +392,7 @@ call s:default('ext2syntax', {}) " syntax map keyed on extension
|
||||
call s:default('hl_headers', 0)
|
||||
call s:default('hl_cb_checked', 0)
|
||||
call s:default('list_ignore_newline', 1)
|
||||
call s:default('listsyms', [' ', '.', 'o', 'O', 'X'])
|
||||
call s:default('listsyms', ' .oOX')
|
||||
call s:default('use_calendar', 1)
|
||||
call s:default('table_mappings', 1)
|
||||
call s:default('table_auto_fmt', 1)
|
||||
|
@ -404,7 +404,7 @@ execute 'syntax match VimwikiList /'.g:vimwiki_rxListDefine.'/'
|
||||
execute 'syntax match VimwikiListTodo /'.g:vimwiki_rxListItem.'/'
|
||||
|
||||
if g:vimwiki_hl_cb_checked == 1
|
||||
execute 'syntax match VimwikiCheckBoxDone /'.g:vimwiki_rxListItemWithoutCB.'\s*\['.g:vimwiki_listsyms[4].'\]\s.*$/ '.
|
||||
execute 'syntax match VimwikiCheckBoxDone /'.g:vimwiki_rxListItemWithoutCB.'\s*\['.g:vimwiki_listsyms_list[4].'\]\s.*$/ '.
|
||||
\ 'contains=VimwikiNoExistsLink,VimwikiLink,@Spell'
|
||||
elseif g:vimwiki_hl_cb_checked == 2
|
||||
execute 'syntax match VimwikiCheckBoxDone /'.g:vimwiki_rxListItemAndChildren.'/ contains=VimwikiNoExistsLink,VimwikiLink,@Spell'
|
||||
|
@ -83,8 +83,8 @@ let g:vimwiki_rxListDefine = '::\(\s\|$\)'
|
||||
call vimwiki#lst#setup_marker_infos()
|
||||
|
||||
let g:vimwiki_rxListItemWithoutCB = '^\s*\%(\('.g:vimwiki_rxListBullet.'\)\|\('.g:vimwiki_rxListNumber.'\)\)\s'
|
||||
let g:vimwiki_rxListItem = g:vimwiki_rxListItemWithoutCB . '\+\%(\[\(['.join(g:vimwiki_listsyms, '').']\)\]\s\)\?'
|
||||
let g:vimwiki_rxListItemAndChildren = '^\(\s*\)\%('.g:vimwiki_rxListBullet.'\|'.g:vimwiki_rxListNumber.'\)\s\+\['.g:vimwiki_listsyms[4].'\]\s.*\%(\n\%(\1\s.*\|^$\)\)*'
|
||||
let g:vimwiki_rxListItem = g:vimwiki_rxListItemWithoutCB . '\+\%(\[\(['.g:vimwiki_listsyms.']\)\]\s\)\?'
|
||||
let g:vimwiki_rxListItemAndChildren = '^\(\s*\)\%('.g:vimwiki_rxListBullet.'\|'.g:vimwiki_rxListNumber.'\)\s\+\['.g:vimwiki_listsyms_list[4].'\]\s.*\%(\n\%(\1\s.*\|^$\)\)*'
|
||||
|
||||
" Preformatted text
|
||||
let g:vimwiki_rxPreStart = '{{{'
|
||||
|
@ -80,8 +80,8 @@ let g:vimwiki_rxListDefine = '::\%(\s\|$\)'
|
||||
call vimwiki#lst#setup_marker_infos()
|
||||
|
||||
let g:vimwiki_rxListItemWithoutCB = '^\s*\%(\('.g:vimwiki_rxListBullet.'\)\|\('.g:vimwiki_rxListNumber.'\)\)\s'
|
||||
let g:vimwiki_rxListItem = g:vimwiki_rxListItemWithoutCB . '\+\%(\[\(['.join(g:vimwiki_listsyms, '').']\)\]\s\)\?'
|
||||
let g:vimwiki_rxListItemAndChildren = '^\(\s*\)\%('.g:vimwiki_rxListBullet.'\|'.g:vimwiki_rxListNumber.'\)\s\+\['.g:vimwiki_listsyms[4].'\]\s.*\%(\n\%(\1\s.*\|^$\)\)*'
|
||||
let g:vimwiki_rxListItem = g:vimwiki_rxListItemWithoutCB . '\+\%(\[\(['.g:vimwiki_listsyms.']\)\]\s\)\?'
|
||||
let g:vimwiki_rxListItemAndChildren = '^\(\s*\)\%('.g:vimwiki_rxListBullet.'\|'.g:vimwiki_rxListNumber.'\)\s\+\['.g:vimwiki_listsyms_list[4].'\]\s.*\%(\n\%(\1\s.*\|^$\)\)*'
|
||||
|
||||
" Preformatted text
|
||||
let g:vimwiki_rxPreStart = '```'
|
||||
|
@ -61,8 +61,8 @@ let g:vimwiki_rxListDefine = '^\%(;\|:\)\s'
|
||||
call vimwiki#lst#setup_marker_infos()
|
||||
|
||||
let g:vimwiki_rxListItemWithoutCB = '^\s*\%(\('.g:vimwiki_rxListBullet.'\)\|\('.g:vimwiki_rxListNumber.'\)\)\s'
|
||||
let g:vimwiki_rxListItem = g:vimwiki_rxListItemWithoutCB . '\+\%(\[\(['.join(g:vimwiki_listsyms, '').']\)\]\s\)\?'
|
||||
let g:vimwiki_rxListItemAndChildren = '^\(\s*\)\%('.g:vimwiki_rxListBullet.'\|'.g:vimwiki_rxListNumber.'\)\s\+\['.g:vimwiki_listsyms[4].'\]\s.*\%(\n\%(\1\s.*\|^$\)\)*'
|
||||
let g:vimwiki_rxListItem = g:vimwiki_rxListItemWithoutCB . '\+\%(\[\(['.g:vimwiki_listsyms.']\)\]\s\)\?'
|
||||
let g:vimwiki_rxListItemAndChildren = '^\('.g:vimwiki_rxListBullet.'\)\s\+\['.g:vimwiki_listsyms_list[4].'\]\s.*\%(\n\%(\1\%('.g:vimwiki_rxListBullet.'\).*\|^$\|\s.*\)\)*'
|
||||
|
||||
" Preformatted text
|
||||
let g:vimwiki_rxPreStart = '<pre>'
|
||||
|
Loading…
Reference in New Issue
Block a user