]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge pull request #377 from mmFooD/code-conceal
authorHiroshi Shirosaki <h.shirosaki@gmail.com>
Thu, 26 Jul 2018 05:07:43 +0000 (14:07 +0900)
committerGitHub <noreply@github.com>
Thu, 26 Jul 2018 05:07:43 +0000 (14:07 +0900)
Added concealends for code items

1  2 
syntax/markdown.vim

diff --combined syntax/markdown.vim
index c8b8faf60df60a8dd1e7264d1e99c9e9f5c76c46,fbf082e968965bed10c9db53b08efe6fe49887f7..566407f8f858968e8044d7e2aba74f83cde475cf
@@@ -94,13 -94,13 +94,13 @@@ syn match  htmlH2       /^.\+\n-\+$/ co
  "define Markdown groups
  syn match  mkdLineBreak    /  \+$/
  syn region mkdBlockquote   start=/^\s*>/                   end=/$/ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell
- syn region mkdCode         start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/\(\([^\\]\|^\)\\\)\@<!`/
- syn region mkdCode         start=/\s*``[^`]*/              end=/[^`]*``\s*/
- syn region mkdCode         start=/^\s*\z(`\{3,}\)[^`]*$/   end=/^\s*\z1`*\s*$/
- syn region mkdCode         start=/\s*\~\~[^\~]*/           end=/[^\~]*\~\~\s*/
- syn region mkdCode         start=/^\s*\z(\~\{3,}\)\s*[0-9A-Za-z_+-]*\s*$/         end=/^\s*\z1\~*\s*$/
- syn region mkdCode         start="<pre[^>]*\\\@<!>"        end="</pre>"
- syn region mkdCode         start="<code[^>]*\\\@<!>"       end="</code>"
+ execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!`/                     end=/\(\([^\\]\|^\)\\\)\@<!`/'  . s:concealends
+ execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!``/ skip=/[^`]`[^`]/   end=/\(\([^\\]\|^\)\\\)\@<!``/' . s:concealends
+ execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(`\{3,}\)[^`]*$/                       end=/^\s*\z1`*\s*$/'            . s:concealends
+ execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!\~\~/  end=/\(\([^\\]\|^\)\\\)\@<!\~\~/'               . s:concealends
+ execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(\~\{3,}\)\s*[0-9A-Za-z_+-]*\s*$/      end=/^\s*\z1\~*\s*$/'           . s:concealends
+ execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<pre[^>]*\\\@<!>"                            end="</pre>"'                   . s:concealends
+ execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<code[^>]*\\\@<!>"                           end="</code>"'                  . s:concealends
  syn region mkdFootnote     start="\[^"                     end="\]"
  syn match  mkdCode         /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/
  syn match  mkdCode         /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
@@@ -115,7 -115,7 +115,7 @@@ syn match  mkdRule         /^\s*_\s\{0,
  " YAML frontmatter
  if get(g:, 'vim_markdown_frontmatter', 0)
    syn include @yamlTop syntax/yaml.vim
 -  syn region Comment matchgroup=mkdDelimiter start="\%^---$" end="^---$" contains=@yamlTop keepend
 +  syn region Comment matchgroup=mkdDelimiter start="\%^---$" end="^\(---\|...\)$" contains=@yamlTop keepend
    unlet! b:current_syntax
  endif
  
@@@ -150,6 -150,7 +150,7 @@@ syn cluster mkdNonListItem contains=@ht
  "highlighting for Markdown groups
  HtmlHiLink mkdString        String
  HtmlHiLink mkdCode          String
+ HtmlHiLink mkdCodeDelimiter String
  HtmlHiLink mkdCodeStart     String
  HtmlHiLink mkdCodeEnd       String
  HtmlHiLink mkdFootnote      Comment