macvim icon indicating copy to clipboard operation
macvim copied to clipboard

Screen error

Open lkebin opened this issue 8 years ago • 35 comments

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

lkebin avatar Aug 06 '18 03:08 lkebin

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.

lowderchris avatar Aug 08 '18 17:08 lowderchris

+1

davidozog avatar Aug 09 '18 14:08 davidozog

+1

jadeallenx avatar Aug 09 '18 16:08 jadeallenx

+1

ZGainsforth avatar Aug 09 '18 23:08 ZGainsforth

+1

xuyuheng avatar Aug 10 '18 08:08 xuyuheng

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.

ychin avatar Aug 10 '18 10:08 ychin

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

dctucker avatar Aug 10 '18 15:08 dctucker

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?

ychin avatar Aug 12 '18 06:08 ychin

  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

eirnym avatar Aug 12 '18 13:08 eirnym

@ychin Is my way to reproduce is good enough?

eirnym avatar Aug 13 '18 22:08 eirnym

@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 avatar Aug 14 '18 09:08 ychin

@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()

eirnym avatar Aug 14 '18 17:08 eirnym

@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 avatar Aug 15 '18 07:08 eirnym

@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 avatar Aug 16 '18 04:08 ychin

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

eirnym avatar Aug 16 '18 07:08 eirnym