macvim-dev/macvim

MacVim pane resize doesn't work in combination with NERDTree and vim-airline

greenchapter opened this issue · 9 comments

Steps to reproduce

To you have to install NERDTree and vim-airline

  1. Start MacVim with > macvim .

Screenshot 2022-11-23 at 21 20 31 (on the screenshot you see the right height of vim-airline)

  1. Jump into the file directory pane and open the NERDTree menu with hitting m on the file.

Screenshot 2022-11-23 at 21 20 37 (the menu spread the vim-airline cmd input line)

  1. Run any command within the NERDTree menu and close the menu
    Screenshot 2022-11-23 at 21 20 50 (the menu spread still exists and is still multiline)

Expected behaviour

The multline spread should go back to a single line (see the orange rectangle)

Screenshot 2022-11-23 at 21 20 50 2

This behaviour only happens within MacVim not the cli version of vim.

Version of Vim and architecture

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Nov 18 2022 12:52:50) macOS version - arm64 Included patches: 1-900 Compiled by Homebrew

Environment

Operating system: macOS Ventura 13.0.1 (22A400)
Terminal: iTerm 2 Build 3.4.18
Value of $TERM: xterm-256color
Shell: zsh

How MacVim was installed

MacVim has been downloaded from GitHub

Logs and stack traces

No response

Vim configuration where issue is reproducable

https://github.com/greenchapter/dotfiles/blob/main/vim/.vimrc

Issue has been tested with given configuration

  • by running MacVim.app from GUI macOS interface
  • by running vim/gvim/etc installed by MacVim
  • by running other versions of vim (e.g. /usr/bin/vim)

Issue has been tested with no configuration

  • by running mvim --clean (or gvim, supplied by MacVim distribution)
  • by running vim --clean (in terminal, supplied by MacVim distribution)
  • by running vim --clean (in terminal, other suppliers, e.g. /usr/bin/vim)

Other conditions

  • The both Homebrew packages "vim" and "macvim" are installed
ychin commented

Are you sure that's MacVim? Seems like you are running CLI Vim instead as you are using iTerm? The version you listed (9.0.0900) also doesn't match any existing MacVim versioning scheme but matches the latest Vim version from Homebrew: https://formulae.brew.sh/formula/vim.

How are you launching MacVim with the macvim command anyway? The default binary we provided is called mvim. Did you manually remap it to something? I think you are just using Homebrew Vim.

ychin commented

You can tell if it is MacVim or not by looking at the fifth line in the :version output to see if it does or does not have GUI support. GUI support => MacVim. No GUI support => Vim.

@greenchapter Thank you for an issue,

Could you provide a little bit more information about your system and configuration?

  1. How you installed MacVim?
  2. What macvim is? is this an applicaiton provided by Homebrew to start macvim?
  3. Which exact version of MacVim do you use? (release version number or git commit if it's a custom build)
  4. If it's a custom build, please provide configure arguments used to build the application?
  5. Which macOS version and on which architecture do you use?

Could you also please test with terminal vim provided by MacVim? the binary is located in installation directory as MacVim.app? @ychin please, guide, where this app is located?

PS: @greenchapter please, also check out the issue preservim/nerdtree#1321 which looks like describe a similar problem as you did but in Ubuntu. Please, tell us if quick fixes provided there are fixing your issue?

ychin commented

You can just type which vim or which macvim in shell and it will tell you. I'm pretty sure @greenchapter is using Homebrew Vim (not MacVim) anyway but just waiting for response to confirm.

Hey guys sorry for my late answer, I had a lot of work to do this week. I will provide you some more details, that you don't have to speculate.

I know the which option btw 😉

* ~ » which mvim
/usr/local/bin/mvim

which is softlinked into the applications folder

* local/bin » l | grep mvim
lrwxr-xr-x   1 root  wheel    42B May 31 21:01 mvim@ -> /Applications/MacVim.app/Contents/bin/mvim

I use the downloaded version of MacVim and vim itself is installed via homebrew. I actually I use this MacVim version Custom Version 9.0.472 (174)

I also tried the NERDTree menu in vim itself and the resizing works without no problems in in the Terminal and also in iTerm2. So it looks to me as a dedicated MacVim issue. That all happens on a aarch64 (Apple Silicon) machine.

Actually that line here coming from preservim/nerdtree#1321 (comment)

let g:NERDTreeMinimalMenu=1

works for me, but is only a workaround 😉

The patch has been proposed in the same issue and I hope it will be fixed soon on the plugin side.

The patch has been proposed in the same issue and I hope it will be fixed soon on the plugin side.

I'm not really sure if it is a problem of NERDTree, because in cli vim it works.

ychin commented

Oh ok that makes more sense. I made that comment before because the Vim version you listed was 9.0.0900 which was the CLI Vim version, not the MacVim version.

Looking through that NERDTree issue, seems like it's a regression in Vim (vim/vim#11286) that was fixed in 9.0.0665. MacVim is currently using Vim 9.0.0472 which still has the bug. The next release would contain this fix from upstream.

For now please just use the workaround.

Closing the issue for now and labeling for the next release (r175). It was a little delayed since I wanted to make sure the smoothscroll fixes get merged upstream before releasing but it should come out by late November hopefully. Feel free to reopen after you update to the latest release and it still contains the bug.