From 41521658b1dca302a4c7125753694b59a317c0f9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 8 Apr 2024 22:42:54 +0200 Subject: vim-patch:9.1.0276: No pandoc syntax support Problem: No pandoc syntax support Solution: Add pandoc syntax and compiler plugins (Wu, Zhenyu, Konfekt) closes: vim/vim#14389 https://github.com/vim/vim/commit/7005b7ee7f282b24378c2a844366cb8616cad5d7 Co-authored-by: Wu, Zhenyu Co-authored-by: Konfekt --- runtime/lua/vim/filetype.lua | 16 ++++++++++------ runtime/lua/vim/filetype/detect.lua | 5 +++++ 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 9f1d237884..bbe1e2c89c 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -662,12 +662,12 @@ local extension = { mws = 'maple', mpl = 'maple', mv = 'maple', - mkdn = 'markdown', - md = 'markdown', - mdwn = 'markdown', - mkd = 'markdown', - markdown = 'markdown', - mdown = 'markdown', + mkdn = detect.markdown, + md = detect.markdown, + mdwn = detect.markdown, + mkd = detect.markdown, + markdown = detect.markdown, + mdown = detect.markdown, mhtml = 'mason', comp = 'mason', mason = 'mason', @@ -762,6 +762,10 @@ local extension = { ora = 'ora', org = 'org', org_archive = 'org', + pandoc = 'pandoc', + pdk = 'pandoc', + pd = 'pandoc', + pdc = 'pandoc', pxsl = 'papp', papp = 'papp', pxml = 'papp', diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua index 3db4f2bcdc..ca2c53b75d 100644 --- a/runtime/lua/vim/filetype/detect.lua +++ b/runtime/lua/vim/filetype/detect.lua @@ -889,6 +889,11 @@ local function m4(contents) end end +--- @type vim.filetype.mapfn +function M.markdown(_, _) + return vim.g.filetype_md or 'markdown' +end + --- Rely on the file to start with a comment. --- MS message text files use ';', Sendmail files use '#' or 'dnl' --- @type vim.filetype.mapfn -- cgit