macvim
macvim copied to clipboard
Buffer scrambles on mouse scroll
Hello,
I'm not sure what the proper term is here, but after the latest update (8.1.873), my buffers frequently "scramble" when I use my mouse wheel to scroll. Screenshot attached.
Any tips? Thanks!
What OS version are you running, and what are you preferences? You can get that by following the steps here by typing the following in a terminal:
defaults read org.vim.MacVim | grep 'MM\|SU'
Hey @ychin, thanks for getting back to me! Here's what I've got:
MacBook Pro:
OS: 10.13.6 (17G65)
Graphics:
Radeon Pro 460 4096 MB
Intel HD Graphics 530 1536 MB
vim:
VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 4 2019 08:13:44)
macOS version
Included patches: 1-873
Compiled by me@my-machine
Huge version with MacVim GUI. Features included (+) or not (-):
+acl +farsi +mouse_sgr -tag_any_white
+arabic +file_in_path -mouse_sysmouse -tcl
+autocmd +find_in_path +mouse_urxvt +termguicolors
+autochdir +float +mouse_xterm +terminal
-autoservername +folding +multi_byte +terminfo
+balloon_eval -footer +multi_lang +termresponse
+balloon_eval_term +fork() -mzscheme +textobjects
+browse +fullscreen +netbeans_intg +textprop
++builtin_terms -gettext +num64 +timers
+byte_offset -hangul_input +odbeditor +title
+channel +iconv +packages +toolbar
+cindent +insert_expand +path_extra +transparency
+clientserver +job +perl/dyn +user_commands
+clipboard +jumplist +persistent_undo +vartabs
+cmdline_compl +keymap +postscript +vertsplit
+cmdline_hist +lambda +printer +virtualedit
+cmdline_info +langmap +profile +visual
+comments +libcall +python/dyn +visualextra
+conceal +linebreak +python3/dyn +viminfo
+cryptv +lispindent +quickfix +vreplace
+cscope +listcmds +reltime +wildignore
+cursorbind +localmap +rightleft +wildmenu
+cursorshape +lua/dyn +ruby/dyn +windows
+dialog_con_gui +menu +scrollbind +writebackup
+diff +mksession +signs -X11
+digraphs +modify_fname +smartindent -xfontset
+dnd +mouse +startuptime +xim
-ebcdic +mouseshape +statusline -xpm
+emacs_tags +mouse_dec -sun_workshop -xsmp
+eval -mouse_gpm +syntax -xterm_clipboard
+ex_extra -mouse_jsbterm +tag_binary -xterm_save
+extra_search +mouse_netterm +tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X -DMACOS_X_DARWIN -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lm -lncurses -liconv -framework AppKit -fstack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE
Preferences:
MMAutosaveColumns = 423;
MMAutosaveRows = 84;
MMCurrentPreferencePane = Advanced;
MMSuppressTerminationAlert = 1;
macvim installed via homebrew, but updated with the in-app auto updater
Unfortunately I am having some troubles reproducing this probably since I'm using Mojave 10.14. How exactly do they scramble? Do they only happen when you are scrolling? Do you use fullscreen at all? Are you sure you only saw this starting in 8.1.873? Do you remember what version you were using previously?
Just a side-note, you may want to use Homebrew to update if you are using Homebrew to insteall MacVim. In general Homebrew doesn't really like it when apps update themselves. I have a TODO to make MacVim not auto-update itself when managed by a package manager (#849) but it's not done yet.
After fiddling with it a bit more it, looks like it happens when I have NerdTree open followed by a tab switch.
Reproduction:
- open a buffer
- toggle NerdTree to open
- open a new tab
- switch back to the original tab
- perform a mouse scroll
I did uninstall macvim and reinstall with homebrew, but it didn't fix it.
Sorry I still couldn't reproduce this. I may need to hunt down a proper 10.13 installation if you keep seeing this.
Just a couple things to help me debug if you have time:
- What exactly does "scramble" mean? Does it go back to normal or is it just permanently hosed? Seems like it only happens with tabs too?
- And you are sure only the recent update to 8.1.713 broke it?
- Do you use fullscreen?
- Do you have tools that manage windows for you like Divvy or Magnet?
- Can you run with
mvim -u NONE -U NONE
and see if this still happens? A related question is whatguioptions
do you have set.
Hopefully this could help nail it down.
Hey thanks so much for digging into this more!
What exactly does "scramble" mean? Does it go back to normal or is it just permanently hosed?
It usually has diagonal lines going across the buffers and "fuzzy" noise near the lines. Sometimes the noise appears to the status line in the middle of the buffer. One time I actually saw the buffer from another tab in the blur.
Sometimes the buffer is unreadable, usually it's only partially "fuzzy". I've always been able to fix it by resizing the window.
Seems like it only happens with tabs too?
Exactly. The recipe seems to be
- open a file
- open a tab and a new file in that tab
- go back to the first tab
- mouse scroll
And you are sure only the recent update to 8.1.713 broke it?
Seems like it. I never saw it previously.
Do you use fullscreen?
No
Do you have tools that manage windows for you like Divvy or Magnet?
No
Can you run with
mvim -u NONE -U NONE
and see if this still happens?
Good tip! Unfortunately it still does. At first I thought it might be NERDTree related, but I was still able to reproduce it by going to a new tab, opening a file, then going back to the previous tab.
I also nuked my .vimrc
to see if that would help but it didn't.
- A related question is what
guioptions
do you have set.
guioptions=egmrL
Thanks again for the hard work here!
One additional detail: it seems to happen more often when I have a vertical split then switch tabs and scroll.
Here's one with my .vimrc
(left buffer) being "ghosted" twice over a completely different file in the right buffer.
same in MacVim Snapshot 155 workaround as it
set guioptions-=r
set guioptions-=L
Finnally, my guioptions=g It's problem of scrollbar rendering
Thanks for the pointer. I reproduced the issue! It is indeed scrollbar related and in particular switching tabs causes one of the scrollbar to hide itself, which triggers the bug.
I will need to look into it, but for now, a workaround I would suggest is do set guioptions+=k
. I actually had it set in my vimrc and forgot to unset it when testing which is why I didn't reproduce this. For now, I recommend just doing this while I look into the issue and push out a fix.
On a side note, I think guioption 'k' generally works better than not having it set that you may not want to go back anyway :)
Perfect, thanks very much for the help!