Skip to content

Commit 49fe37f

Browse files
committed
perf(line_num): honor exclude_filetypes
1 parent 5465dd3 commit 49fe37f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lua/hlchunk/mods/line_num/init.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,16 @@ end
4747
function LineNumMod:createAutocmd()
4848
BaseMod.createAutocmd(self)
4949

50+
local bufnr = api.nvim_get_current_buf()
51+
local exclude_filetypes = self.conf.exclude_filetypes
52+
if exclude_filetypes[vim.bo[bufnr].buftype] then
53+
return
54+
end
55+
5056
api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
5157
group = self.meta.augroup_name,
5258
callback = function(event)
53-
local bufnr = event.buf
59+
bufnr = event.buf
5460
local winnr = api.nvim_get_current_win()
5561
local pos = api.nvim_win_get_cursor(winnr)
5662
local retcode, cur_chunk_range = chunkHelper.get_chunk_range({

0 commit comments

Comments
 (0)