]> 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:

Change function name to camel case as others
authorHiroshi Shirosaki <h.shirosaki@gmail.com>
Tue, 19 Jan 2016 12:02:23 +0000 (21:02 +0900)
committerHiroshi Shirosaki <h.shirosaki@gmail.com>
Tue, 19 Jan 2016 12:02:23 +0000 (21:02 +0900)
ftplugin/markdown.vim
test/syntax.vader

index c43b0bde4db440d6f92d289321389f214799243b..1ce35a89be59515d026ee773118d79b67edbc609 100644 (file)
@@ -609,7 +609,7 @@ let s:filetype_dict = {
     \ 'viml': 'vim'
 \ }
 
     \ 'viml': 'vim'
 \ }
 
-function! s:Markdown_highlight_sources(force)
+function! s:MarkdownHighlightSources(force)
     " Syntax highlight source code embedded in notes.
     " Look for code blocks in the current file
     let filetypes = {}
     " Syntax highlight source code embedded in notes.
     " Look for code blocks in the current file
     let filetypes = {}
@@ -635,7 +635,7 @@ function! s:Markdown_highlight_sources(force)
                 let filetype = ft
             endif
             let group = 'mkdSnippet' . toupper(substitute(filetype, "[+-]", "_", "g"))
                 let filetype = ft
             endif
             let group = 'mkdSnippet' . toupper(substitute(filetype, "[+-]", "_", "g"))
-            let include = s:syntax_include(filetype)
+            let include = s:SyntaxInclude(filetype)
             let command = 'syntax region %s matchgroup=%s start="^\s*```%s$" matchgroup=%s end="\s*```$" keepend contains=%s%s'
             execute printf(command, group, startgroup, ft, endgroup, include, has('conceal') ? ' concealends' : '')
             execute printf('syntax cluster mkdNonListItem add=%s', group)
             let command = 'syntax region %s matchgroup=%s start="^\s*```%s$" matchgroup=%s end="\s*```$" keepend contains=%s%s'
             execute printf(command, group, startgroup, ft, endgroup, include, has('conceal') ? ' concealends' : '')
             execute printf('syntax cluster mkdNonListItem add=%s', group)
@@ -645,7 +645,7 @@ function! s:Markdown_highlight_sources(force)
     endfor
 endfunction
 
     endfor
 endfunction
 
-function! s:syntax_include(filetype)
+function! s:SyntaxInclude(filetype)
     " Include the syntax highlighting of another {filetype}.
     let grouplistname = '@' . toupper(a:filetype)
     " Unset the name of the current syntax while including the other syntax
     " Include the syntax highlighting of another {filetype}.
     let grouplistname = '@' . toupper(a:filetype)
     " Unset the name of the current syntax while including the other syntax
@@ -670,16 +670,16 @@ function! s:syntax_include(filetype)
 endfunction
 
 
 endfunction
 
 
-function! s:Markdown_refresh_syntax(force)
+function! s:MarkdownRefreshSyntax(force)
     if &filetype == 'markdown' && line('$') > 1
     if &filetype == 'markdown' && line('$') > 1
-        call s:Markdown_highlight_sources(a:force)
+        call s:MarkdownHighlightSources(a:force)
     endif
 endfunction
 
 augroup Mkd
     autocmd!
     endif
 endfunction
 
 augroup Mkd
     autocmd!
-    au BufWinEnter * call s:Markdown_refresh_syntax(1)
-    au BufWritePost * call s:Markdown_refresh_syntax(0)
-    au InsertEnter,InsertLeave * call s:Markdown_refresh_syntax(0)
-    au CursorHold,CursorHoldI * call s:Markdown_refresh_syntax(0)
+    au BufWinEnter * call s:MarkdownRefreshSyntax(1)
+    au BufWritePost * call s:MarkdownRefreshSyntax(0)
+    au InsertEnter,InsertLeave * call s:MarkdownRefreshSyntax(0)
+    au CursorHold,CursorHoldI * call s:MarkdownRefreshSyntax(0)
 augroup END
 augroup END
index bdc599f39dadb8cadc6686131fa4b97611578ef2..e63ce7ef95def80c266dc919b99f724e151be36a 100644 (file)
@@ -268,7 +268,7 @@ end
 ```
 
 Execute (fenced code block syntax with a language specifier):
 ```
 
 Execute (fenced code block syntax with a language specifier):
-  let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'Markdown_refresh_syntax')
+  let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
   call b:func(0)
   AssertEqual SyntaxOf('include'), 'cInclude'
   AssertEqual SyntaxOf('code'), 'mkdSnippetCPP'
   call b:func(0)
   AssertEqual SyntaxOf('include'), 'cInclude'
   AssertEqual SyntaxOf('code'), 'mkdSnippetCPP'
@@ -280,7 +280,7 @@ code
 ```
 
 Execute (fenced code block syntax with an unknown language specifier):
 ```
 
 Execute (fenced code block syntax with an unknown language specifier):
-  let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'Markdown_refresh_syntax')
+  let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
   call b:func(0)
   AssertEqual SyntaxOf('code'), 'mkdSnippetA_B_'
 
   call b:func(0)
   AssertEqual SyntaxOf('code'), 'mkdSnippetA_B_'