Macvim: Screen error

Created on 6 Aug 2018  路  35Comments  路  Source: macvim-dev/macvim

I have extra monitor. When I start MacVim on the extra monitor, it looks like that:
screen shot 2018-08-06 at 11 41 51 am

If I drag the MacVim program window to resize it, the screen will be fine.
macvim

Most helpful comment

For anyone looking for a temporary fix (and there certainly might be a better way to do this), you could add a similar command(s) to your .gvimrc file,

set columns=90
autocmd VimEnter * set columns=100

Previously, I had specified my default window size with 90 columns. The second command then initiates a resize after opening the window, forcing a redraw, and correcting the issue (just be sure to specify different sizes). This is definitely far from ideal, but forces things into a working state while waiting on a fix for the issue.

All 35 comments

I can confirm that I'm seeing the same issue on a second monitor.

Running into the same issue (and resizing fix) on an external DisplayPort monitor. With the same monitor connected, when opening a macvim window on the laptop display, the window renders as expected.

The issue appeared in snapshot-150, snapshot-149 was good.

+1 , same issue here. Resizing window with mouse makes the window immediately snap to correct size

+1, same issue. Attempting to roll back to 149

+1 here. If you open on the main monitor, it works just fine. If you open it on the second (non-main) monitor you get the behavior described

+1 Confirmed. This is particularly troubling since I want MacVim to always launch on my rightmost monitor.

+1

+1

+1 same issue.

+1

The same is happening when you open a narrow window, for example, 69x42, and then open a window with local setting set width (or height) bigger than it was. Any way to force redrwaw works, including hiding MacVim or switching an app

Build 149 didn't had this issue.

+1

+1

+1

Hello,

I switched back to version 8.1-149_1 (brew) but had the same problem. switching further back to version 8.1-147 resolved my problem for the moment.

--jason

This problem is due to https://github.com/macvim-dev/macvim/commit/378032d85e8cbb75d02d58c77cdc530dfd7b418a (#708). And this guioptions-k seems not to work (in my environment).
I think should revert it once.

+1

+1. Hitting this issue after the recent update.

+1; reverted to snapshot-149 (8.1.72 (149)) which does not manifest the problem.

For anyone looking for a temporary fix (and there certainly might be a better way to do this), you could add a similar command(s) to your .gvimrc file,

set columns=90
autocmd VimEnter * set columns=100

Previously, I had specified my default window size with 90 columns. The second command then initiates a resize after opening the window, forcing a redraw, and correcting the issue (just be sure to specify different sizes). This is definitely far from ideal, but forces things into a working state while waiting on a fix for the issue.

+1

+1

+1

+1

I submitted a PR #727 to revert the change that introduced this bug. If someone can grab it and build locally to test it out that would be appreciated. I'm not at a place to be able to test external monitors right now.

Building ychin's branch solved the problem for me. Can anyone else confirm?

The same is happening when you open a narrow window, for example, 69x42, and then open a window with local setting set width (or height) bigger than it was. Any way to force redrwaw works, including hiding MacVim or switching an app

@eirnym Can you explain a little more in how your repro case worked? What commands are you running?

1) Open a window with a random file, e.g. ~/.vim/vimrc and set some small width, like 20, next time it should open a _window_ with the same width, you can check it by pressing Cmd-N
2) set for some filetype specific width to use, e.g. for Python files (it doesn't matter)
3) open file of this type, with $ vim ~/example.py or with :e ~/example.py

Notes:
if you don't open a file but an empty buffer on step 1, MacVim might won't save and trick won't work from command line but will with :e command in the same window

  if has('gui_running')
        setlocal columns=85
    endif

A quick demonstration
out

@ychin Is my way to reproduce is good enough?

@eirnym I couldn't reproduce the issue on my laptop. Did you only reproduce this using your method on an external monitor? If so I just need to hunt down an external monitor to connect to so I can debug it.

@ychin I have no external monitor

my minimal vimrc with I able to reproduce it (build 150)

fun! PythonSetup()
    setlocal ts=4 sts=4 sw=4 nu
    setlocal colorcolumn=79
    if has('gui_running')
        setlocal columns=85
    endif
endfun

autocmd FileType python call PythonSetup()

@ychin The problem with my issue is somewhere else, it's reproducable in build 122 (earlier builds don't want to be opened on my setup ;) )

I'll open a separate issue

@eirnym Oh good to know. But also sad that that means I will have to hunt down an external monitor to test still.

Also check out #557 which I suspect could be related. You can try the suggestions from this comment (https://github.com/macvim-dev/macvim/issues/557#issuecomment-339556291) to see if it helps by setting MMUseCGLayerAlways to true. It causes other issues such as scrolling performance but it's nice to know if it's related at least.

@ychin please, look into #732, it could be the source of many resizing issues

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bmulholland picture bmulholland  路  5Comments

jsholmes picture jsholmes  路  4Comments

louiswolfers picture louiswolfers  路  5Comments

alex-protean picture alex-protean  路  3Comments

0xDP picture 0xDP  路  5Comments