diff options
author | Guldoman <giulio.lettieri@gmail.com> | 2022-06-08 07:13:24 +0200 |
---|---|---|
committer | Guldoman <giulio.lettieri@gmail.com> | 2022-06-09 13:28:17 +0200 |
commit | 6944dadb1041ee8323ccbf68c40770299f67ae35 (patch) | |
tree | 03e2a2fc8433029dfc19ff6fb55fdd34f4694a97 | |
parent | 022c86485707902131f91e5f5b4fb388a09e3464 (diff) | |
download | lite-xl-plugins-6944dadb1041ee8323ccbf68c40770299f67ae35.tar.gz lite-xl-plugins-6944dadb1041ee8323ccbf68c40770299f67ae35.zip |
`minimap`: allow per-`DocView` toggle even if globally disabled
-rw-r--r-- | plugins/minimap.lua | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/minimap.lua b/plugins/minimap.lua index f2638c8..7c4ddab 100644 --- a/plugins/minimap.lua +++ b/plugins/minimap.lua @@ -198,8 +198,12 @@ local function show_minimap(docview) if not docview:is(DocView) then return false end if not config.plugins.minimap.enabled - or not docview:is(DocView) - or per_docview[docview] == false + and per_docview[docview] ~= true + then + return false + elseif + config.plugins.minimap.enabled + and per_docview[docview] == false then return false end @@ -535,6 +539,7 @@ end command.add(nil, { ["minimap:toggle-visibility"] = function() config.plugins.minimap.enabled = not config.plugins.minimap.enabled + setmetatable({}, { __mode = "k" }) end, ["minimap:toggle-syntax-highlighting"] = function() config.plugins.minimap.syntax_highlight = not config.plugins.minimap.syntax_highlight @@ -543,7 +548,11 @@ command.add(nil, { command.add("core.docview!", { ["minimap:toggle-visibility-for-current-view"] = function() - per_docview[core.active_view] = per_docview[core.active_view] == false + if config.plugins.minimap.enabled then + per_docview[core.active_view] = per_docview[core.active_view] == false + else + per_docview[core.active_view] = not per_docview[core.active_view] + end end }) |