Skip to content

Commit 8c34584

Browse files
committed
perf(line_num): honor exclude_filetypes
1 parent 5465dd3 commit 8c34584

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lua/hlchunk/mods/line_num/init.lua

+4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@ end
4747
function LineNumMod:createAutocmd()
4848
BaseMod.createAutocmd(self)
4949

50+
local this = self
5051
api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
5152
group = self.meta.augroup_name,
5253
callback = function(event)
5354
local bufnr = event.buf
55+
if not this:shouldRender(bufnr) then
56+
return true -- delete automcmd
57+
end
5458
local winnr = api.nvim_get_current_win()
5559
local pos = api.nvim_win_get_cursor(winnr)
5660
local retcode, cur_chunk_range = chunkHelper.get_chunk_range({

0 commit comments

Comments
 (0)