aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-04-03 16:27:49 +0200
committerGitHub <noreply@github.com>2023-04-03 16:27:49 +0200
commite30cc8be1950a6d1dec7395807966e1b5d0d9194 (patch)
tree461c9e98cc9b1344bb861489cf3e6838d69a1add /runtime/lua
parentf34b849a22044874d8be0afe7fd455e45246740e (diff)
downloadrneovim-e30cc8be1950a6d1dec7395807966e1b5d0d9194.tar.gz
rneovim-e30cc8be1950a6d1dec7395807966e1b5d0d9194.tar.bz2
rneovim-e30cc8be1950a6d1dec7395807966e1b5d0d9194.zip
vim-patch:9.0.1438: .fs files are falsely recognized as forth files (#22871)
Problem: .fs files are falsely recognized as forth files. Solution: Check 100 lines for something that looks like forth. (Johan Kotlinski, closes vim/vim#12219, closes vim/vim#11988) https://github.com/vim/vim/commit/065088d5549e7711668321cc5a77c9a9b684b142 Co-authored-by: Johan Kotlinski <kotlinski@gmail.com>
Diffstat (limited to 'runtime/lua')
-rw-r--r--runtime/lua/vim/filetype/detect.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua
index b3d9fedeae..d1eabadc4a 100644
--- a/runtime/lua/vim/filetype/detect.lua
+++ b/runtime/lua/vim/filetype/detect.lua
@@ -473,12 +473,12 @@ function M.fs(bufnr)
if vim.g.filetype_fs then
return vim.g.filetype_fs
end
- local line = nextnonblank(bufnr, 1)
- if findany(line, { '^%s*%.?%( ', '^%s*\\G? ', '^\\$', '^%s*: %S' }) then
- return 'forth'
- else
- return 'fsharp'
+ for _, line in ipairs(getlines(bufnr, 1, 100)) do
+ if line:find('^[:(\\] ') then
+ return 'forth'
+ end
end
+ return 'fsharp'
end
function M.git(bufnr)