From: Hiroshi Shirosaki Date: Wed, 1 Feb 2017 05:57:39 +0000 (+0900) Subject: Merge pull request #309 from michaelPotter/master X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/72e39306ddbc172932a57b3bee503fc5e487fde0?hp=bb39f5d769c0ed3152f621fd61cc455f1b480918 Merge pull request #309 from michaelPotter/master Syntax Concealing for italic/bold/italicbold Items --- diff --git a/.travis.yml b/.travis.yml index a913cd7..ab79fcd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_script: | export PATH="/usr/local/bin:$PATH" cd "$TRAVIS_BUILD_DIR" fi - sudo pip install virtualenv + sudo -H pip install virtualenv stty cols 80 script: diff --git a/README.md b/README.md index edd177b..17c97b9 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,12 @@ let g:vim_markdown_folding_style_pythonic = 1 Level 1 heading which is served as a document title is not folded. `g:vim_markdown_folding_level` setting is not active with this fold style. +To prevent foldtext from being set add the following to your `.vimrc`: + +```vim +let g:vim_markdown_override_foldtext = 0 +``` + ### Set header folding level Folding level is a number between 1 and 6. By default, if not specified, it is set to 1. diff --git a/after/ftplugin/markdown.vim b/after/ftplugin/markdown.vim index 6265db3..cdf0a26 100644 --- a/after/ftplugin/markdown.vim +++ b/after/ftplugin/markdown.vim @@ -150,7 +150,7 @@ let s:vim_markdown_folding_level = get(g:, "vim_markdown_folding_level", 1) if !get(g:, "vim_markdown_folding_disabled", 0) setlocal foldexpr=Foldexpr_markdown(v:lnum) setlocal foldmethod=expr - if get(g:, "vim_markdown_folding_style_pythonic", 0) + if get(g:, "vim_markdown_folding_style_pythonic", 0) && get(g:, "vim_markdown_override_foldtext", 1) setlocal foldtext=Foldtext_markdown() endif endif diff --git a/doc/vim-markdown.txt b/doc/vim-markdown.txt index 0d12a1d..3ee30e6 100644 --- a/doc/vim-markdown.txt +++ b/doc/vim-markdown.txt @@ -96,6 +96,10 @@ To fold in a style like python-mode [6], add the following to your '.vimrc': Level 1 heading which is served as a document title is not folded. 'g:vim_markdown_folding_level' setting is not active with this fold style. +To prevent foldtext from being overridden, add the following to your '.vimrc': + + let g:vim_markdown_override_foldtext = 0 + ------------------------------------------------------------------------------- *vim-markdown-set-header-folding-level* Set header folding level ~ diff --git a/syntax/markdown.vim b/syntax/markdown.vim index 35a1d82..5df0430 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -105,7 +105,7 @@ syn region mkdFootnote start="\[^" end="\]" syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/ syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ contained -syn match mkdListItem /^\s*\%([-*+]\|\d\+\.\)\s\+/ contained +syn match mkdListItem /^\s*\%([-*+]\|\d\+\.\)\ze\s\+/ contained syn region mkdListItemLine start="^\s*\%([-*+]\|\d\+\.\)\s\+" end="$" oneline contains=@mkdNonListItem,mkdListItem,@Spell syn region mkdNonListItemBlock start="\(\%^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@!\|\n\(\_^\_$\|\s\{4,}[^ ]\|\t+[^\t]\)\@!\)" end="^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@=" contains=@mkdNonListItem,@Spell syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*$/