Skip to content

Commit

Permalink
Guess indentation when changing the file type
Browse files Browse the repository at this point in the history
  • Loading branch information
Elouan Martinet committed Nov 26, 2024
1 parent 6cd61f7 commit 977fde5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/guess-indent/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ local function setup_autocommands()
})
end,
})
vim.api.nvim_create_autocmd("FileType", {
group = augroup,
desc = "Guess indentation when changing the file type",
callback = function(args)
M.set_from_buffer(args.buf, true, true)
end,
})
end

-- Return true if the string looks like an inline comment.
Expand Down

0 comments on commit 977fde5

Please sign in to comment.