You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is very annoying to try each and every colour scheme one by one by typing set colorscheme [name] again and again. It would be much faster and easier if Micro just temporarily switch to the colour theme (preview) when the name is selected like below.
2023-01-10-15-33-19.mp4
The text was updated successfully, but these errors were encountered:
In principle it should be possible with a simple Lua plugin like the following:
local config = import("micro/config")
local origColorscheme = config.GetGlobalOption("colorscheme")
local tempColorscheme = nil
function onCommandComplete(bp)
if bp.PromptType == "Command" and bp.Buf:Line(0):match("^set colorscheme ") and
bp.Buf.HasSuggestions and bp.Buf.CurSuggestion >= 0 then
tempColorscheme = bp.Buf.Completions[bp.Buf.CurSuggestion + 1]
config.SetGlobalOption("colorscheme", tempColorscheme)
end
end
function onExecuteCommand(bp)
if tempColorscheme ~= nil and tempColorscheme ~= origColorscheme then
origColorscheme = tempColorscheme
end
end
function onAbortCommand(bp)
if tempColorscheme ~= nil and tempColorscheme ~= origColorscheme then
config.SetGlobalOption("colorscheme", origColorscheme)
tempColorscheme = nil
end
end
Unfortunately, as I've found, micro currently executes onAction callbacks only for actions triggered in a normal buffer pane only, not in the command bar, so those onCommandComplete, onExecuteCommand, onAbortCommand functions are never executed (so I cannot even test if the above Lua code is correct). But I think it should not be too difficult to fix this limitation in micro.
It is very annoying to try each and every colour scheme one by one by typing
set colorscheme [name]
again and again. It would be much faster and easier if Micro just temporarily switch to the colour theme (preview) when the name is selected like below.2023-01-10-15-33-19.mp4
The text was updated successfully, but these errors were encountered: