aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-09-25 22:29:25 +0800
committerGitHub <noreply@github.com>2022-09-25 16:29:25 +0200
commitf8a1cadccff39923643fdea2e282be9fffa60e99 (patch)
treef40ff35a3322dcf758f688d89333d86d0f855212 /test
parent91e912f8d40284c74d4a997c8c95961eebb35d91 (diff)
downloadrneovim-f8a1cadccff39923643fdea2e282be9fffa60e99.tar.gz
rneovim-f8a1cadccff39923643fdea2e282be9fffa60e99.tar.bz2
rneovim-f8a1cadccff39923643fdea2e282be9fffa60e99.zip
fix(filetype): use :setf instead of nvim_buf_set_option (#20334)
Diffstat (limited to 'test')
-rw-r--r--test/functional/lua/filetype_spec.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/lua/filetype_spec.lua b/test/functional/lua/filetype_spec.lua
index be57b2db31..2a7be53164 100644
--- a/test/functional/lua/filetype_spec.lua
+++ b/test/functional/lua/filetype_spec.lua
@@ -1,6 +1,7 @@
local helpers = require('test.functional.helpers')(after_each)
local exec_lua = helpers.exec_lua
local eq = helpers.eq
+local meths = helpers.meths
local clear = helpers.clear
local pathroot = helpers.pathroot
local command = helpers.command
@@ -94,3 +95,10 @@ describe('vim.filetype', function()
]])
end)
end)
+
+describe('filetype.lua', function()
+ it('does not override user autocommands that set filetype #20333', function()
+ clear({args={'--clean', '--cmd', 'autocmd BufRead *.md set filetype=notmarkdown', 'README.md'}})
+ eq('notmarkdown', meths.buf_get_option(0, 'filetype'))
+ end)
+end)