aboutsummaryrefslogtreecommitdiff
path: root/runtime/filetype.lua
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2024-06-08 21:40:18 +0200
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2024-06-28 19:58:31 +0200
commitaa6b9c677d83d76d448c3bb0973bf8d14bfdf922 (patch)
tree11b53f3dfac47faa94b375280d392959c754f4bd /runtime/filetype.lua
parent496091b63241f33dffc15411e35e89d8018e6fa2 (diff)
downloadrneovim-aa6b9c677d83d76d448c3bb0973bf8d14bfdf922.tar.gz
rneovim-aa6b9c677d83d76d448c3bb0973bf8d14bfdf922.tar.bz2
rneovim-aa6b9c677d83d76d448c3bb0973bf8d14bfdf922.zip
refactor: use `vim._with` where possible
This mostly means replacing `nvim_buf_call` and `nvim_win_call` with `vim._with`.
Diffstat (limited to 'runtime/filetype.lua')
-rw-r--r--runtime/filetype.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/filetype.lua b/runtime/filetype.lua
index be76af787d..797033da06 100644
--- a/runtime/filetype.lua
+++ b/runtime/filetype.lua
@@ -21,7 +21,7 @@ vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile', 'StdinReadPost' }, {
-- Generic configuration file used as fallback
ft = require('vim.filetype.detect').conf(args.file, args.buf)
if ft then
- vim.api.nvim_buf_call(args.buf, function()
+ vim._with({ buf = args.buf }, function()
vim.api.nvim_cmd({ cmd = 'setf', args = { 'FALLBACK', ft } }, {})
end)
end
@@ -32,7 +32,7 @@ vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile', 'StdinReadPost' }, {
on_detect(args.buf)
end
- vim.api.nvim_buf_call(args.buf, function()
+ vim._with({ buf = args.buf }, function()
vim.api.nvim_cmd({ cmd = 'setf', args = { ft } }, {})
end)
end