macvim icon indicating copy to clipboard operation
macvim copied to clipboard

Issues after last commit to src/MacVim/MMBackend.m

Open 0xDP opened this issue 5 years ago • 6 comments

Describe the bug I have several issues with the current master:

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 30 2020 15:13:09) macOS version Included patches: 1-830

At startup, at least some of the highlight commands from gvimrc are not executed. For example, I have:

set cursorline
set cursorlineopt=screenline
hi CursorLine	NONE
hi CursorLine	gui=underline	guisp=gray

but do not get a underline. Furthermore I sometimes see artifacts of my status bar while scrolling.

Screenshot 2020-05-30 at 14 37 58

I suspect the latest changes in src/MacVim/MMBackend.m as the reason for this behaviour. If I revert this part of the commit:

         while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true)
                   == kCFRunLoopRunHandledSource)
              ;   // do nothing
+       [self processInputQueue];
  }
  - (void)flushQueue:(BOOL)force

I can no longer reproduce the issues and MacVIM behaves as before.

Can someone please check whether the [self processInputQueue]; is necessary at this point or whether it can cause such problems?

Environment (please complete the following information):

  • VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 30 2020 15:13:09), Included patches: 1-830
  • OS: macOS 10.15.5
  • GUI: MacVIM

0xDP avatar May 30 '20 13:05 0xDP

Sorry, I could not reproduce... Please present the minimal executable example: vimrc, gvimrc, a few user input, using Core Text renderer or not.

ichizok avatar Jun 04 '20 11:06 ichizok

The missing highlightings seems to be caused by my colorscheme (NeoSolarized). Strange, that worked before.

For the rendering issue:

  • empty ~/.vimrc

  • ~/.gvimrc with the following content (ther's a space at the end of the first line):

set statusline=\ %<%f\ [%{&ff}]%h%m%r\ \ %=%-20.(%l/%L,%c%V%)\ %P\ 
set laststatus=2
  • start MacVim
  • open MMBackend.m
  • scroll the buffer up and down

With this minimal setup this does not happen as often as in the screenshot above, but it happens.

% defaults read org.vim.MacVim
{
    MMAppearanceModeSelection = 0;
    MMAutosaveColumns = 191;
    MMAutosaveRows = 50;
    MMCurrentPreferencePane = Advanced;
    MMDisableLaunchAnimation = 1;
    MMLastWindowClosedBehavior = 2;
    MMOpenInCurrentWindow = 1;
    MMRenderer = 1;	
    MMSuppressTerminationAlert = 1;
    MMTitlebarAppearsTransparent = 1;
    MMTopLeftPoint = "{17, 855}";
    MMUntitledWindow = 1;
    NSFontPanelAttributes = "1, 4";
    NSQuotedKeystrokeBinding = "";
    NSRepeatCountBinding = "";
    "NSWindow Frame NSFontPanel" = "929 110 445 237 0 0 1440 877 ";
    SUEnableAutomaticChecks = 0;
    SUHasLaunchedBefore = 1;
    SUSendProfileInfo = 0;
}

0xDP avatar Jun 04 '20 15:06 0xDP

Hmm.. I could not reproduce. What your configure/build steps of MacVim?

My env and steps: On macOS 10.13.6 / 10.15.5,

export CPPFLAGS=-DWE_ARE_PROFILING
export CFLAGS=-Wall -Wextra -Wshadow -Wno-unknown-pragmas -g -glldb -O0
export LDFLAGS=-Wl,-no_pie
./configure --prefix=/usr/local --enable-gui=macvim --disable-nls --enable-multibyte --enable-terminal --with-tlib=ncurses --with-features=huge --enable-fail-if-missing --enable-luainterp=dynamic --with-lua-prefix=/usr/local/opt/luajit --with-luajit --enable-perlinterp=dynamic --enable-python3interp=dynamic --enable-rubyinterp=dynamic --with-ruby-command=/usr/local/opt/ruby/bin/ruby --with-xcodecfg=Debug
make

launch from

./src/MacVim/build/Debug/MacVim.app/Contents/MacOS/Vim -g src/MacVim/MMBackend.m

or from ./src/MacVim/build/Debug/MacVim.app (double-click App icon), and then input <C-f>, <C-b>, j, and k several times.

ichizok avatar Jun 08 '20 02:06 ichizok

macOS 10.15.5, no CPPFLAGS, no LDFLAGS

% echo $CFLAGS
-O2 -fno-caret-diagnostics -fno-color-diagnostics -fno-diagnostics-fixit-info -pipe -pedantic -Weverything -Wunused-macros -Wno-padded -Wno-format-nonliteral -Wno-switch-enum -Wno-covered-switch-default -Wno-sign-conversion -Wno-shorten-64-to-32 -Wno-reserved-id-macro -Wno-disabled-macro-expansion -Wno-documentation-unknown-command -Wno-documentation-deprecated-sync -Wsign-compare

I run configure and make like this

./configure && make -s -j 4
./src/MacVim/build/Debug/MacVim.app/Contents/MacOS/Vim -g src/MacVim/MMBackend.m

I made a screen recording where I scroll with two fingers on the trackpad of the MacBook Pro (28,6MB): http://d--p.de/tmp/2020-06-08_MacVim.mov Test conditions as described above, empty ~/.vimrc and ~/.gvimrc with two lines (first line ends with a space):

set statusline=\ %<%f\ [%{&ff}]%h%m%r\ \ %=%-20.(%l/%L,%c%V%)\ %P\ 
set laststatus=2

Maybe scrolling with the trackpad makes the difference.

0xDP avatar Jun 08 '20 11:06 0xDP

I made a screen recording where I scroll with two fingers on the trackpad of the MacBook Pro (28,6MB): http://d--p.de/tmp/2020-06-08_MacVim.mov

Ups, the url got lost. http://d--p.de/tmp/2020-06-08_MacVim.mov

0xDP avatar Jun 08 '20 11:06 0xDP

I could reproduce on my new Retina machine (I had only non-Retina machines until yesterday..). Reverting [self processInputQueue] makes CI fail, thus I'll do it and comment-out the test as workaround, and then I'd like to consider other solution.

ichizok avatar Jun 10 '20 02:06 ichizok