Skip to content

Commit

Permalink
fix(:CompilerRedo): correct encapsulation of current_filetype fro…
Browse files Browse the repository at this point in the history
…m the previous commit.
  • Loading branch information
Zeioth committed Apr 25, 2024
1 parent 60571f0 commit a3c9e36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/compiler/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ M.setup = function(opts)
end, { desc = "Toggle the compiler results" })

cmd("CompilerRedo", function()
local current_filetype = vim.bo.filetype

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

0 comments on commit a3c9e36

Please sign in to comment.