Skip to content
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

only one window #10

Open
tonywoode opened this issue Mar 19, 2020 · 8 comments
Open

only one window #10

tonywoode opened this issue Mar 19, 2020 · 8 comments

Comments

@tonywoode
Copy link

tonywoode commented Mar 19, 2020

About 15% of the time, when I have zoomed into a window, the underlying layout disappears, so when I use my leader combo to return to the previous layout, vim informs me there is only one window. This plugin otherwise does everything really well (and I've tried some alternatives that don't)

I can't isolate the conditions under which this happens, I'm sure its nothing obvious like when I open/close/restore my terminal, since this can happen at any point. (Although I do use https://github.com/tpope/vim-obsession and https://github.com/dhruvasagar/vim-prosession and lately i've wondered if their session-catpure refreshes might be to blame)

It does seem like it only happens if I have more than one tab open, but that's probably symptomatic of how the plugin works, rather than of the problem. But certainly all other tabs don't disappear when this happens, just the tab I zoomed 'into'...

Can anyone suggest how to troubleshoot or ease?

@troydm
Copy link
Owner

troydm commented Mar 19, 2020

This happens to me too at one point or another but rarely, not sure why it's happening, it would be nice to pinpoint the cause or at least find a way to reproduce this issue so I could debug it.

btw, do you use default Ctrl-W o keybinding to zoom in, I have a hunch that it happens because sometimes I accidently hit Ctrl-W Ctrl-O instead of Ctrl-W o

@tonywoode
Copy link
Author

yup, that makes a lot of sense, yup when I CTRL_W CTRL_O that's exactly what happens! Thank you for the quick response and immediate easing of the issue (i'll let you know should I be able to disprove this)

However, why is this the case since all your commands should map both CTRL_W O and CTRL_W CTRL_O to the same action?
https://github.com/troydm/zoomwintab.vim/blob/master/plugin/zoomwintab.vim#L88
https://github.com/troydm/zoomwintab.vim/blob/master/plugin/zoomwintab.vim#L91
(and yes i get the same behaviour in terminal or macvim)

@troydm
Copy link
Owner

troydm commented Mar 22, 2020

@tonywoode not sure actually, sorry had a really busy week and I haven't had time to investigate it yet, probably it somehow interprets Ctrl-O separately ignoring the mapping or something, I'll investigate it when I'll have time

@troydm
Copy link
Owner

troydm commented Apr 7, 2020

@tonywoode I've managed to find a bug it was <C-w_o> mapping related which made other buffers to close so I've added additional default mapping which will remap this key mapping to zooming, just update your plugin to latest commit, also I'm closing this bug so if you think that this doesn't fixes your problem please feel free to reopen it

@troydm troydm closed this as completed Apr 7, 2020
@tonywoode
Copy link
Author

thanks everso: sure i've updated glad you found the issue!

@tonywoode
Copy link
Author

tonywoode commented Sep 20, 2021

Sorry would like to reopen this (but I don't have the option here: you'd have to do it), I still seem to manage to reproduce the bug with the same frequency as previously (despite being on 3b33368)

Something I notice is that I always seem to trigger it at the very worst moment: namely when i'm demonstrating something to others. I would guess that other people watching me makes me sloppier and more prone to error on the keyboard due to reduced ability to concentrate (again suggesting that your Crtl-O observation would be a likely cause, however as your related recent commits suggest: I cannot now trigger :only with any combo of ctrl+O, so I can't work out how i'm continuing to cause it. I was wondering if its possible to trigger an :only keyboard combo by including the original combo as part of a larger command, but Ctrl_w takes no count...I am a NerdTree user, perhaps you are too?

@tonywoode
Copy link
Author

I think I was on the right track there: provide a window number to 'o' and :only is triggered: i.e. hit: Ctrl+w, 2 , o and the second window becomes the only window. I don't think that's directly it, as I wouldn't often reach up to a number in the middle of a command, and I always end up with the window I inteded to maximise as the only window - so I wonder if there is a more-likely second key to have pressed than a window number - is there a key for 'current/cursor' window perhaps?

@troydm
Copy link
Owner

troydm commented Oct 10, 2021

@tonywoode you are absolutely right about C-w, 2, o combination, it reproduces this issue, I'm reopening the bug and will try to figure out how to mitigate this and which key combinations trigger this issue more often, so far I'm thinking of introducing special option which will rebind :only combinations to zoomwintab if enabled, for now I've added additional mappings in last commit that seem like the fix the issue, please try it out and tell me if it helps

@troydm troydm reopened this Oct 10, 2021
rohanorton added a commit to rohanorton/vim-config that referenced this issue Aug 26, 2022
Having issues with the default keybindings
(troydm/zoomwintab.vim#10) so created a custom
one that isn't busted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants