Skip to content

Commit a3c9e36

Browse files
committed
fix(:CompilerRedo): correct encapsulation of current_filetype from the previous commit.
1 parent 60571f0 commit a3c9e36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/compiler/init.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ M.setup = function(opts)
1616
end, { desc = "Toggle the compiler results" })
1717

1818
cmd("CompilerRedo", function()
19+
local current_filetype = vim.bo.filetype
20+
1921
-- If the user didn't select an option yet, send a notification.
2022
if _G.compiler_redo_selection == nil and _G.compiler_redo_bau_selection == nil then
2123
vim.notify("Open the compiler and select an option before doing redo.",
@@ -25,7 +27,6 @@ M.setup = function(opts)
2527
end
2628
if _G.compiler_redo_filetype then
2729
-- If filetype is not the same as when the option was selected, send a notification.
28-
local current_filetype = vim.bo.filetype
2930
if _G.compiler_redo_filetype ~= current_filetype then
3031
vim.notify("You are on a different language now. Open the compiler and select an option before doing redo.",
3132
vim.log.levels.INFO, { title = "Compiler.nvim" }

0 commit comments

Comments
 (0)