Refactor: Vars: Make vimwiki_list_ignore_newline wiki local (Issue #894)

Also: vimwiki_text_ignore_newline
This commit is contained in:
Tinmarino
2020-07-30 15:49:38 -04:00
parent 787e95b910
commit 97e02897f4
3 changed files with 61 additions and 67 deletions

View File

@ -1037,7 +1037,7 @@ function! s:process_tag_list(line, lists) abort
call add(lines, substitute(a:line, lstRegExp.'\%('.checkbox.'\)\?', '', ''))
let processed = 1
elseif in_list && a:line =~# '^\s\+\S\+'
if vimwiki#vars#get_global('list_ignore_newline')
if vimwiki#vars#get_wikilocal('list_ignore_newline')
call add(lines, a:line)
else
call add(lines, '<br />'.a:line)
@ -1085,7 +1085,7 @@ function! s:process_tag_para(line, para) abort
let para = 1
endif
let processed = 1
if vimwiki#vars#get_global('text_ignore_newline')
if vimwiki#vars#get_wikilocal('text_ignore_newline')
call add(lines, a:line)
else
call add(lines, a:line.'<br />')

View File

@ -193,8 +193,6 @@ function! s:read_global_settings_from_user() abort
\ 'table_format': 1, 'table_mappings': 1, 'lists': 1, 'links': 1,
\ 'html': 1, 'mouse': 0,
\ }},
\ 'list_ignore_newline': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
\ 'text_ignore_newline': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
\ 'links_header': {'type': type(''), 'default': 'Generated Links', 'min_length': 1},
\ 'links_header_level': {'type': type(0), 'default': 1, 'min': 1, 'max': 6},
\ 'listsyms': {'type': type(''), 'default': ' .oOX', 'min_length': 2},
@ -376,6 +374,7 @@ function! s:populate_wikilocal_options() abort
\ 'html_filename_parameterization': {'type': type(0), 'default': 0, 'min': 0, 'max': 1},
\ 'index': {'type': type(''), 'default': 'index', 'min_length': 1},
\ 'links_space_char': {'type': type(''), 'default': ' ', 'min_length': 1},
\ 'list_ignore_newline': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
\ 'list_margin': {'type': type(0), 'default': -1, 'min': -1},
\ 'listsym_rejected': {'type': type(''), 'default': vimwiki#vars#get_global('listsym_rejected')},
\ 'listsyms': {'type': type(''), 'default': vimwiki#vars#get_global('listsyms')},
@ -392,6 +391,7 @@ function! s:populate_wikilocal_options() abort
\ 'template_default': {'type': type(''), 'default': 'default', 'min_length': 1},
\ 'template_ext': {'type': type(''), 'default': '.tpl'},
\ 'template_path': {'type': type(''), 'default': $HOME . '/vimwiki/templates/'},
\ 'text_ignore_newline': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
\ 'toc_header': {'type': type(''), 'default': 'Contents', 'min_length': 1},
\ 'toc_header_level': {'type': type(0), 'default': 1, 'min': 1, 'max': 6},
\ 'toc_link_format': {'type': type(0), 'default': 0, 'min': 0, 'max': 1},