From 661985c62bb2e1dde5c17a34fa450e30371c49b4 Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 6 Sep 2024 19:58:03 +0200 Subject: [PATCH] fix: set ft after detecting --- lua/codemp/buffers.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/codemp/buffers.lua b/lua/codemp/buffers.lua index 9e56ffe..58d0a9f 100644 --- a/lua/codemp/buffers.lua +++ b/lua/codemp/buffers.lua @@ -90,7 +90,8 @@ local function attach(name, buffer, content, nowait) controller:callback(function (_controller) async:send() end) vim.defer_fn(function() async:send() end, 500) -- force a try_recv after 500ms - vim.filetype.match({ buf = buffer }) + local filetype = vim.filetype.match({ buf = buffer }) + vim.api.nvim_set_option_value("filetype", filetype, { buf = buffer }) print(" ++ attached to buffer " .. name) return controller end