Skip to content

Commit b4d21f1

Browse files
zeertzjqzzzyxwvut
andauthored
vim-patch:71149df: runtime(java): Dismiss "g:markdown_fenced_languages" for Java buffers (neovim#35596)
No support is provided or planned for language recognition in code snippets of documentation comments. Requesting to load arbitrary syntax plugins with the aid of the concerned variable is therefore wasteful in general and erroneous when paired languages ":syn-include" one another without taking steps to manage circularity. related: vim/vim#17308 related: vim/vim#17220 closes: vim/vim#18172 vim/vim@71149df Co-authored-by: Aliaksei Budavei <[email protected]>
1 parent 4f374bf commit b4d21f1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

runtime/syntax/java.vim

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com>
44
" Former Maintainer: Claudio Fleiner <[email protected]>
55
" Repository: https://github.com/zzzyxwvut/java-vim.git
6-
" Last Change: 2025 Aug 07
6+
" Last Change: 2025 Aug 30
77

88
" Please check ":help java.vim" for comments on some of the options
99
" available.
@@ -447,6 +447,11 @@ if !exists("g:java_ignore_javadoc") && (s:with_html || s:with_markdown) && g:mai
447447
unlet g:html_syntax_folding
448448
endif
449449

450+
if !empty(get(g:, 'markdown_fenced_languages', []))
451+
let s:markdown_fenced_languages_copy = g:markdown_fenced_languages
452+
unlet g:markdown_fenced_languages
453+
endif
454+
450455
syntax include @javaMarkdown syntax/markdown.vim
451456

452457
try
@@ -464,6 +469,11 @@ if !exists("g:java_ignore_javadoc") && (s:with_html || s:with_markdown) && g:mai
464469
finally
465470
unlet! b:current_syntax
466471

472+
if exists("s:markdown_fenced_languages_copy")
473+
let g:markdown_fenced_languages = s:markdown_fenced_languages_copy
474+
unlet s:markdown_fenced_languages_copy
475+
endif
476+
467477
if exists("s:html_syntax_folding_copy")
468478
let g:html_syntax_folding = s:html_syntax_folding_copy
469479
unlet s:html_syntax_folding_copy

0 commit comments

Comments
 (0)