bugfix: Stop executing t:CtrlSpaceWinrestcmd#306
Conversation
Minion3665
commented
Oct 30, 2022
- Previously this caused an interaction with other plugins where if they opened other windows this would cause ctrlspace to shrink windows to the minimum size
- (From :help winrestcmd()) "Only works properly when no windows are opened or closed and the current window and tab page is unchanged"
- From testing in Sometimes the current layout window shrinks to max when triggering the buffer list. #271 it seems that this line is not required, so this commit removes it
- This PR will close Sometimes the current layout window shrinks to max when triggering the buffer list. #271
- Previously this caused an interaction with other plugins where if they opened other windows this would cause ctrlspace to shrink windows to the minimum size - (From :help winrestcmd()) "Only works properly when no windows are opened or closed and the current window and tab page is unchanged" - From testing in vim-ctrlspace#271 it seems that this line is not required, so this commit removes it - This commit will close vim-ctrlspace#271
|
@Konfekt here's the PR I was talking about; I've tested it on my system a little and everything seems to be going fine, but obviously review the code as well before merging (it's very small) |
|
Thank you! There are other occurrences of silent! exe t:CtrlSpaceWinrestcmdand accompanying commands to set Also, how about making the removed code instead conditional on Nvim as long as no Vim users chime in. |
True, my fault. So instead of restoring the faulty windows layout by silent! exe t:CtrlSpaceWinrestcmdnow all windows are made equal by wincmd =How about adding case distinction with a comment on I'd then wait for Vim users complaining about the same issue to enact the current code change. |
- As Neovim users are the users who seem to be facing the issue with t:CtrlSpaceWinrestcmd, it seems like a good idea to still resize the windows back for vim users - Notwithstanding the help message that winrestcmd() "Only works properly when no windows are opened or closed and the current window and tab page is unchanged" in vim, as no vim users have come forward saying they have an issue we believe there to be none
|
Thank you! |
If you look at `:h winrestcmd` it says:
```
winrestcmd() *winrestcmd()*
Returns a sequence of |:resize| commands that should restore
the current window sizes. Only works properly when no windows
are opened or closed and the current window and tab page is
unchanged.
Example: >vim
let cmd = winrestcmd()
call MessWithWindowSizes()
exe cmd
```
We can't guarantee this, so don't try to restore windows.
Refs: neoclide/coc.nvim#4178 (comment)
Refs: vim-ctrlspace/vim-ctrlspace#306
Fixes: junegunn#74
Fixes: junegunn#83

