From af4c73e79388d037c12262648876785884d6456f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20=E9=87=91=E5=8F=AF=E6=98=8E?= Date: Tue, 3 Oct 2023 18:45:26 +0200 Subject: [PATCH] fix(html): make sure html ftplugin does not get triggered with other filetypes --- ftplugin/html.vim | 5 +++++ helper/src/config.rs | 3 +-- plugin/doge.vim | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ftplugin/html.vim b/ftplugin/html.vim index a06afa5e..c6249591 100644 --- a/ftplugin/html.vim +++ b/ftplugin/html.vim @@ -1,6 +1,11 @@ let s:save_cpo = &cpoptions set cpoptions&vim +" The HTML filetype also gets triggerred for PHP files (and perhaps others). +if &filetype !=? 'html' + finish +endif + let b:doge_parser = 'html' let b:doge_insert = 'above' diff --git a/helper/src/config.rs b/helper/src/config.rs index ad4de29e..f50eaf25 100644 --- a/helper/src/config.rs +++ b/helper/src/config.rs @@ -26,8 +26,7 @@ pub fn load_doc_config_str<'a>(parser_name: &'a str, doc_name: &'a str) -> &'a s "c_kernel_doc" => include_str!("c/docs/kernel_doc.yaml"), "php_phpdoc" => include_str!("php/docs/phpdoc.yaml"), - "typescript_jsdoc" => include_str!("typescript/docs/jsdoc.yaml"), - "html_jsdoc" => include_str!("typescript/docs/jsdoc.yaml"), + "typescript_jsdoc" | "html_jsdoc" => include_str!("typescript/docs/jsdoc.yaml"), "lua_ldoc" => include_str!("lua/docs/ldoc.yaml"), "java_javadoc" => include_str!("java/docs/javadoc.yaml"), "ruby_YARD" => include_str!("ruby/docs/YARD.yaml"), diff --git a/plugin/doge.vim b/plugin/doge.vim index bd116255..6eae9e62 100644 --- a/plugin/doge.vim +++ b/plugin/doge.vim @@ -100,8 +100,8 @@ let g:doge_filetype_aliases = doge#utils#deepextend({ \ 'typescript', \ 'typescript.tsx', \ ], -\ 'java': ['groovy'], \ 'html': ['svelte', 'vue'], +\ 'java': ['groovy'], \}, get(g:, 'doge_filetype_aliases', {}), 1) if !exists('g:doge_buffer_mappings')