From c9229244a819755f165c4f116f1b213a1a0d3c90 Mon Sep 17 00:00:00 2001 From: Rane Brown Date: Sat, 30 Mar 2019 21:52:56 -0600 Subject: [PATCH] Don't change conceal behavior of wiki elements with max_urlsave option. Closes #539 --- doc/vimwiki.txt | 3 ++- syntax/vimwiki.vim | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 82c8eb3..5049ddc 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -2962,7 +2962,8 @@ Default: 1 Setting the value of |g:vimwiki_url_maxsave| to 0 will prevent any link shortening: you will see the full URL in all types of links, with no parts -being concealed. Concealing of one-character markers is not affected. +being concealed. This option does not affect the concealing of wiki elements +such as bold, italic, wikilinks, etc. When positive, the value determines the maximum number of characters that are retained at the end after concealing the middle part of a long URL. diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index 30b0e5b..94cf1c5 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -175,15 +175,14 @@ execute 'syn match VimwikiSubScript contained /'. \ vimwiki#vars#get_syntaxlocal('char_subscript').'/'.s:conceal - - - let s:options = ' contained transparent contains=NONE' +if exists("+conceallevel") + let s:options .= s:conceal +endif " A shortener for long URLs: LinkRest (a middle part of the URL) is concealed " VimwikiLinkRest group is left undefined if link shortening is not desired if exists("+conceallevel") && vimwiki#vars#get_global('url_maxsave') > 0 - let s:options .= s:conceal execute 'syn match VimwikiLinkRest `\%(///\=[^/ \t]\+/\)\zs\S\+\ze' \.'\%([/#?]\w\|\S\{'.vimwiki#vars#get_global('url_maxsave').'}\)`'.' cchar=~'.s:options endif