macvim icon indicating copy to clipboard operation
macvim copied to clipboard

Buffer scrambles on mouse scroll

Open traviswsims opened this issue 6 years ago • 10 comments

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!

macvim

traviswsims avatar Feb 12 '19 15:02 traviswsims

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'

ychin avatar Feb 13 '19 02:02 ychin

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

traviswsims avatar Feb 13 '19 03:02 traviswsims

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.

ychin avatar Feb 18 '19 10:02 ychin

After fiddling with it a bit more it, looks like it happens when I have NerdTree open followed by a tab switch.

Reproduction:

  1. open a buffer
  2. toggle NerdTree to open
  3. open a new tab
  4. switch back to the original tab
  5. perform a mouse scroll

I did uninstall macvim and reinstall with homebrew, but it didn't fix it.

traviswsims avatar Feb 18 '19 18:02 traviswsims

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 what guioptions do you have set.

Hopefully this could help nail it down.

ychin avatar Feb 18 '19 22:02 ychin

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.

screen shot 2019-02-19 at 11 43 02 am

Seems like it only happens with tabs too?

Exactly. The recipe seems to be

  1. open a file
  2. open a tab and a new file in that tab
  3. go back to the first tab
  4. 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.

screen shot 2019-02-19 at 11 37 31 am

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!

traviswsims avatar Feb 19 '19 17:02 traviswsims

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.

screen shot 2019-02-19 at 11 59 50 am

traviswsims avatar Feb 19 '19 18:02 traviswsims

same in MacVim Snapshot 155 workaround as it

set guioptions-=r
set guioptions-=L

Finnally, my guioptions=g It's problem of scrollbar rendering

epheien avatar Feb 22 '19 05:02 epheien

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 :)

ychin avatar Feb 22 '19 07:02 ychin

Perfect, thanks very much for the help!

traviswsims avatar Feb 22 '19 16:02 traviswsims