commit a5bda652d064bfa884f0774e108ad727af5fa704
parent 82ba1e99bf5deb963d93db781b494a7d25dfd690
Author: Patrik Willard <patrik.willard@padowi.se>
Date: Tue, 9 Apr 2019 07:34:34 +0200
Add option to not conceal one-character markers
Adds new configuration variable, "conceal_onechar_markers", defaulting
to on (preserving default behaviour)
Adds if-statement around relevant parts of code (as suggested in the
issue), which uses the new configuration variable.
Fix #315 - Don't conceal one-character markers
Diffstat:
3 files changed, 32 insertions(+), 18 deletions(-)
diff --git a/autoload/vimwiki/vars.vim b/autoload/vimwiki/vars.vim
@@ -145,6 +145,7 @@ function! s:read_global_settings_from_user()
\ 'auto_chdir': {'type': type(0), 'default': 0, 'min': 0, 'max': 1},
\ 'autowriteall': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
\ 'conceallevel': {'type': type(0), 'default': 2, 'min': 0, 'max': 3},
+ \ 'conceal_onechar_markers': {'type': type(0), 'default': 1, 'min': 0, 'max': 1},
\ 'conceal_pre': {'type': type(0), 'default': 0, 'min': 0, 'max': 1},
\ 'create_link': {'type': type(0), 'default': 1, 'min':0, 'max': 1},
\ 'diary_months': {'type': type({}), 'default':
diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt
@@ -2958,6 +2958,17 @@ Default: 2
------------------------------------------------------------------------------
+*g:vimwiki_conceal_onechar_markers*
+
+Control the concealment of one-character markers.
+
+Setting 'conceal_onechar_markers' to 0 will show the markers, overriding
+whatever value is set in |g:vimwiki_conceallevel|
+
+Default: 1
+
+
+------------------------------------------------------------------------------
*g:vimwiki_conceal_pre*
Conceal preformatted text markers. For example,
diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim
@@ -155,24 +155,26 @@ endfor
" possibly concealed chars
let s:conceal = exists("+conceallevel") ? ' conceal' : ''
-execute 'syn match VimwikiEqInChar contained /'.
- \ vimwiki#vars#get_syntaxlocal('char_eqin').'/'.s:conceal
-execute 'syn match VimwikiBoldChar contained /'.
- \ vimwiki#vars#get_syntaxlocal('char_bold').'/'.s:conceal
-execute 'syn match VimwikiItalicChar contained /'.
- \ vimwiki#vars#get_syntaxlocal('char_italic').'/'.s:conceal
-execute 'syn match VimwikiBoldItalicChar contained /'.
- \ vimwiki#vars#get_syntaxlocal('char_bolditalic').'/'.s:conceal
-execute 'syn match VimwikiItalicBoldChar contained /'.
- \ vimwiki#vars#get_syntaxlocal('char_italicbold').'/'.s:conceal
-execute 'syn match VimwikiCodeChar contained /'.
- \ vimwiki#vars#get_syntaxlocal('char_code').'/'.s:conceal
-execute 'syn match VimwikiDelTextChar contained /'.
- \ vimwiki#vars#get_syntaxlocal('char_deltext').'/'.s:conceal
-execute 'syn match VimwikiSuperScript contained /'.
- \ vimwiki#vars#get_syntaxlocal('char_superscript').'/'.s:conceal
-execute 'syn match VimwikiSubScript contained /'.
- \ vimwiki#vars#get_syntaxlocal('char_subscript').'/'.s:conceal
+if vimwiki#vars#get_global('conceal_onechar_markers') == 1
+ execute 'syn match VimwikiEqInChar contained /'.
+ \ vimwiki#vars#get_syntaxlocal('char_eqin').'/'.s:conceal
+ execute 'syn match VimwikiBoldChar contained /'.
+ \ vimwiki#vars#get_syntaxlocal('char_bold').'/'.s:conceal
+ execute 'syn match VimwikiItalicChar contained /'.
+ \ vimwiki#vars#get_syntaxlocal('char_italic').'/'.s:conceal
+ execute 'syn match VimwikiBoldItalicChar contained /'.
+ \ vimwiki#vars#get_syntaxlocal('char_bolditalic').'/'.s:conceal
+ execute 'syn match VimwikiItalicBoldChar contained /'.
+ \ vimwiki#vars#get_syntaxlocal('char_italicbold').'/'.s:conceal
+ execute 'syn match VimwikiCodeChar contained /'.
+ \ vimwiki#vars#get_syntaxlocal('char_code').'/'.s:conceal
+ execute 'syn match VimwikiDelTextChar contained /'.
+ \ vimwiki#vars#get_syntaxlocal('char_deltext').'/'.s:conceal
+ execute 'syn match VimwikiSuperScript contained /'.
+ \ vimwiki#vars#get_syntaxlocal('char_superscript').'/'.s:conceal
+ execute 'syn match VimwikiSubScript contained /'.
+ \ vimwiki#vars#get_syntaxlocal('char_subscript').'/'.s:conceal
+endif
let s:options = ' contained transparent contains=NONE'