From 97e02897f4d7e50c2b0761e590d1ac9785ca2661 Mon Sep 17 00:00:00 2001 From: Tinmarino Date: Thu, 30 Jul 2020 15:49:38 -0400 Subject: [PATCH] Refactor: Vars: Make vimwiki_list_ignore_newline wiki local (Issue #894) Also: vimwiki_text_ignore_newline --- autoload/vimwiki/html.vim | 4 +- autoload/vimwiki/vars.vim | 4 +- doc/vimwiki.txt | 120 ++++++++++++++++++-------------------- 3 files changed, 61 insertions(+), 67 deletions(-) diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index a8038ee..2193f02 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -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, '
'.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.'
') diff --git a/autoload/vimwiki/vars.vim b/autoload/vimwiki/vars.vim index 4a56fa1..dbcfd52 100644 --- a/autoload/vimwiki/vars.vim +++ b/autoload/vimwiki/vars.vim @@ -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}, diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 5d6d7e0..461760f 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -2685,7 +2685,6 @@ Set this option to a list of file patterns to exclude when checking or generating links: > let g:vimwiki_list = [{'path': '~/my_site/', 'exclude_files': ['**/README.md']}] - *vimwiki-option-html_filename_parameterization* ------------------------------------------------------------------------------ Key Default value Values~ @@ -2700,6 +2699,30 @@ regeneration of HTML files. This setting also turns off the automatic deletion of files in the site_html directory which don't match existing wiki files. +------------------------------------------------------------------------------ +*g:vimwiki_list_ignore_newline* + +This is HTML related. +Convert newlines to
s in multiline list items. + +Value Description~ +0 Newlines in a list item are converted to
s. +1 Ignore newlines. + +Default: 1 + +------------------------------------------------------------------------------ +*g:vimwiki_text_ignore_newline* + +This is HTML related. +Convert newlines to
s in text. + +Value Description~ +0 Newlines in text are converted to
s. +1 Ignore newlines. + +Default: 1 + *vimwiki-option-rss_name* ------------------------------------------------------------------------------ Key Default value~ @@ -2729,6 +2752,39 @@ This setting specifies the URL where the generated VimWiki HTML pages can be reached. It is used for the link to the RSS feed and for links to the diary entries inside the feed. +------------------------------------------------------------------------------ +*g:vimwiki_toc_header* + +A string with the magic header that tells Vimwiki where the Table of Contents +(see |vimwiki-toc|) is located in a file. You can change it to the +appropriate word in your mother tongue like this: > + let g:vimwiki_toc_header = 'Inhalt' + +The default is 'Contents'. + +------------------------------------------------------------------------------ +*g:vimwiki_toc_header_level* + +The header level of the Table of Contents (see |vimwiki-toc|). Valid values +are from 1 to 6. + +The default is 1. + +------------------------------------------------------------------------------ +*g:vimwiki_toc_link_format* + +The format of the links in the Table of Contents (see |vimwiki-toc|). + + +Value Description~ +0 Extended: The link contains the description and URL. URL + references all levels. +1 Brief: The link contains only the URL. URL references only + the immediate level. + +Default: 0 + + ------------------------------------------------------------------------------ 12.4 Global Options *vimwiki-global-options* @@ -2894,32 +2950,6 @@ Limitations: The options above can be suffixed with ':quick' (e.g.: 'expr:quick') in order to use some workarounds to make folds work faster. ------------------------------------------------------------------------------- -*g:vimwiki_list_ignore_newline* - -This is HTML related. -Convert newlines to
s in multiline list items. - -Value Description~ -0 Newlines in a list item are converted to
s. -1 Ignore newlines. - -Default: 1 - - ------------------------------------------------------------------------------- -*g:vimwiki_text_ignore_newline* - -This is HTML related. -Convert newlines to
s in text. - -Value Description~ -0 Newlines in text are converted to
s. -1 Ignore newlines. - -Default: 1 - - ------------------------------------------------------------------------------ *g:vimwiki_use_calendar* @@ -3343,42 +3373,6 @@ let g:vimwiki_diary_months = { \ 10: 'October', 11: 'November', 12: 'December' \ } - ------------------------------------------------------------------------------- -*g:vimwiki_toc_header* - -A string with the magic header that tells Vimwiki where the Table of Contents -(see |vimwiki-toc|) is located in a file. You can change it to the -appropriate word in your mother tongue like this: > - let g:vimwiki_toc_header = 'Inhalt' - -The default is 'Contents'. - - ------------------------------------------------------------------------------- -*g:vimwiki_toc_header_level* - -The header level of the Table of Contents (see |vimwiki-toc|). Valid values -are from 1 to 6. - -The default is 1. - - ------------------------------------------------------------------------------- -*g:vimwiki_toc_link_format* - -The format of the links in the Table of Contents (see |vimwiki-toc|). - - -Value Description~ -0 Extended: The link contains the description and URL. URL - references all levels. -1 Brief: The link contains only the URL. URL references only - the immediate level. - -Default: 0 - - ------------------------------------------------------------------------------ *g:vimwiki_map_prefix*