From ff1266aaaaba80f86ab9624eea8939d644d7e730 Mon Sep 17 00:00:00 2001 From: Jonas Strittmatter <40792180+smjonas@users.noreply.github.com> Date: Wed, 10 Aug 2022 13:44:57 +0200 Subject: vim-patch:9.0.0182: quarto files are not recognized (#19702) Problem: Quarto files are not recognized. Solution: Recognize quarto files by the extension. (Jonas Strittmatter, closes vim/vim#10880) https://github.com/vim/vim/commit/3a9687fb2749cb3da6e3bbf60cb9eaa81f7889ae --- runtime/lua/vim/filetype.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 1b209e6a9d..e9e81caec0 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -776,6 +776,7 @@ local extension = { ptl = 'python', ql = 'ql', qll = 'ql', + qmd = 'quarto', R = function(path, bufnr) return require('vim.filetype.detect').r(bufnr) end, -- cgit From a850b15e1968476e0f609a9d699cdf24fd13e3a2 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 13 Aug 2022 10:26:12 +0200 Subject: vim-patch:9.0.0195: metafun files are not recogized (#19746) Problem: Metafun files are not recogized. Solution: Add filetype detection patterns. https://github.com/vim/vim/commit/9032b9ceb6073288d75386dbcbd9d1982fa24080 --- runtime/lua/vim/filetype.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index e9e81caec0..3cfc4e288a 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -668,6 +668,21 @@ local extension = { moo = 'moo', moon = 'moonscript', mp = 'mp', + mpiv = function(path, bufnr) + return 'mp', function(b) + vim.b[b].mp_metafun = 1 + end + end, + mpvi = function(path, bufnr) + return 'mp', function(b) + vim.b[b].mp_metafun = 1 + end + end, + mpxl = function(path, bufnr) + return 'mp', function(b) + vim.b[b].mp_metafun = 1 + end + end, mof = 'msidl', odl = 'msidl', msql = 'msql', -- cgit From 33b49d5f55423a1a3174ad0ce42c4454871aa9f8 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 13 Aug 2022 15:11:03 +0200 Subject: vim-patch:9.0.0197: astro files are not detected (#19755) Problem: Astro files are not detected. Solution: Add a pattern to match Astro files. (Emilia Zapata, closes vim/vim#10904) https://github.com/vim/vim/commit/6a76e84f555da6d9ee57db80143e1e5eb85535ff --- runtime/lua/vim/filetype.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 3cfc4e288a..872106b20d 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -142,6 +142,7 @@ local extension = { asp = function(path, bufnr) return require('vim.filetype.detect').asp(bufnr) end, + astro = 'astro', atl = 'atlas', as = 'atlas', ahk = 'autohotkey', -- cgit From b2f979b30beac67906b2dd717fcb6a34f46f5e54 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 19 Aug 2022 19:30:35 +0200 Subject: fix(filetype): only check first 100 and last line of buffer (#19819) fix(filetype): only pass first 100 and last lines to contents check sufficient for current content checks and avoids performance issues for buffers with a large number of lines fixes #19817 --- runtime/lua/vim/filetype.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 872106b20d..99c98764dd 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -2489,7 +2489,15 @@ function M.match(args) -- Finally, check file contents if contents or bufnr then - contents = contents or M.getlines(bufnr) + if contents == nil then + if api.nvim_buf_line_count(bufnr) > 101 then + -- only need first 100 and last line for current checks + contents = M.getlines(bufnr, 1, 100) + contents[#contents + 1] = M.getlines(bufnr, -1) + else + contents = M.getlines(bufnr) + end + end -- If name is nil, catch any errors from the contents filetype detection function. -- If the function tries to use the filename that is nil then it will fail, -- but this enables checks which do not need a filename to still work. -- cgit