File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -220,8 +220,9 @@ local function get_excluded_treesitter()
220
220
return tree_lines , tree_chars
221
221
end
222
222
223
- local function auto_heuristic ()
224
- log (" Testing for auto heuristic..." )
223
+ --- @param reason string
224
+ local function auto_heuristic (reason )
225
+ log (" Testing for auto heuristic because of event " .. reason )
225
226
226
227
if vim .b .wrapmode ~= nil then
227
228
log (" wrapmode already set for this buffer" )
@@ -422,7 +423,16 @@ M.setup = function(o)
422
423
-- we can use what's in there.
423
424
vim .api .nvim_create_autocmd (" BufWinEnter" , {
424
425
group = vim .api .nvim_create_augroup (" wrapping" , {}),
425
- callback = auto_heuristic ,
426
+ callback = function ()
427
+ auto_heuristic (" BufWinEnter" )
428
+ end ,
429
+ })
430
+
431
+ vim .api .nvim_create_autocmd (" OptionSet" , {
432
+ pattern = " filetype" ,
433
+ callback = function ()
434
+ auto_heuristic (" OptionSet" )
435
+ end ,
426
436
})
427
437
end
428
438
end
You can’t perform that action at this time.
0 commit comments