Fix so zen mode doesnt exit when leaping in normal mode.
This commit is contained in:
parent
dcd14d7eec
commit
334b18e309
2 changed files with 16 additions and 2 deletions
|
|
@ -12,9 +12,17 @@ local function leap_in_current_buffer()
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function normal_mode_leap()
|
||||||
|
if _G["snacks_zen_mode"] then
|
||||||
|
leap_in_current_buffer()
|
||||||
|
else
|
||||||
|
leap_across_windows()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function M.set_leap_keymapping()
|
function M.set_leap_keymapping()
|
||||||
require("utils").foreach({
|
require("utils").foreach({
|
||||||
{ "n", "m", leap_across_windows },
|
{ "n", "m", normal_mode_leap },
|
||||||
{ "v", "m", leap_in_current_buffer },
|
{ "v", "m", leap_in_current_buffer },
|
||||||
{ "o", "m", leap_in_current_buffer }
|
{ "o", "m", leap_in_current_buffer }
|
||||||
}, function(mapping)
|
}, function(mapping)
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,13 @@ return {
|
||||||
},
|
},
|
||||||
zen = {
|
zen = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
toggles = { dim = false, }
|
toggles = { dim = false, },
|
||||||
|
on_open = function()
|
||||||
|
_G["snacks_zen_mode"] = true
|
||||||
|
end,
|
||||||
|
on_close = function()
|
||||||
|
_G["snacks_zen_mode"] = false
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue