-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with folke/zen-mode.nvim #116
Comments
I can reproduce. Single-window search works, the problem appears when other windows are included, like in your custom command ( In your specific case, a quick fix would be: local function leapSearch()
zen_mode_active = ... -- left as an exercise to the reader
-- Restricting Leap to the current window if ZenMode is active.
leap.leap { target_windows = zen_mode_active and vim.fn.win_getid() or vim.tbl_filter(
function(win) return vim.api.nvim_win_get_config(win).focusable end,
vim.api.nvim_tabpage_list_wins(0)
) }
end |
Zen-mode automatically closes whenever the window loses focus by design, so that's indeed what's causing this here |
And we are finding targets... where if not in the current (floating) window? |
I'm assuming in the windows below the zen window? The zen window is a float. |
Yeah, I guess the window below remains focusable. If that is the case, you could fix this on your side (instead of adding checks to the Leap call) by explicitly setting the all other windows on the tab page non-focusable when the Zen window is opened. |
As I mentioned, that's how it's supposed to work. If the original window would no longer be focusable, then the user also can't Op should just fix the function he uses like you suggested |
Right, got it. TBH, I thought you can only exit a zen window with its dedicated toggle, but I guess a floating island from which you can "jump off" is a valid mental model too. |
That's how I use it 😄 I mapped just the arrow keys to navigate between windows, so I simply do left or right to exit zen-mode. |
ZenMode
ZenMode
exits and the cursor does not move.leap config:
zen-mode config:
The text was updated successfully, but these errors were encountered: