Loading ...
Sorry, an error occurred while loading the content.

Vim splits resize switching between dual monitors

Expand Messages
  • lessthanideal
    (By viewport I mean window in the vim sense as opposed to the application window.) Using Vim 7.3 patches 1 - 333 (the Vim without Cream version) on XP SP3. I
    Message 1 of 2 , Nov 1, 2011
    • 0 Attachment
      (By viewport I mean "window in the vim sense" as opposed to
      the application window.)

      Using Vim 7.3 patches 1 - 333 (the Vim without Cream
      version) on XP SP3.

      I have a dual-monitor system, both monitors are
      the same size and resolution, the left-hand monitor is the
      primary one so no negative desktop coordinates. I use the
      http://dualmonitortool.sourceforge.net/swapscreen.html
      utility, pressing Ctrl-F12 moves the selected window between
      the two monitors. It seems to do this by making the window
      redraw (visually it looks like it's redrawing all the
      pieces). The problem is that sometimes, doing this
      adjusts the position of horizontal splits on gvim.

      I can reproduce the problem like this:

      Invoke with gvim.exe -N -u NONE -U NONE -i NONE

      Maximize the application

      :split
      The maximized vim now has two viewports
      of equal height

      Ctrl-F12
      The application is now on the other monitor, the
      split has moved so the lower viewport is five lines
      taller than the upper.

      I can't pin down exactly what triggers it, but it always
      happens if you make the upper viewport much taller than
      the lower. It happens with more than two viewports. Nothing
      odd happens with just one viewport. It happens starting
      from either monitor and switching to the other. It doesn't
      happen if the application window isn't maximized, even if it
      is stretched to the same size as it would be maximized. It
      doesn't affect vertical splits.

      My monitors are 1280x1024. If I adjust to e.g. 1024x768
      the above sequence doesn't work, but it's still generally
      reproducible by changing the viewport sizes and switching
      between monitors.

      So my questions are

      Has anyone seen a similar problem before, if so how did you
      address it?

      Failing that ... any suggestions? Presumably the easiest
      workaround is to reset the viewport sizes when this happens.
      Can Vim tell when its window has moved? (FocusLost event
      triggers but maybe there's a better way.)

      Would restoring the viewport sessions be a simple task,
      presumably they would have to be saved whenever they changed
      (I can't see an event for this, maybe CursorHold would do)
      then restored afterwards.

      I could use winheight and resize to save and restore the
      values.

      Can anyone suggest a better approach, or comment on whether
      this is likely to be extremely complicated? It's only
      an incovenience so spending a lot of time fixing it wouldn't
      be worth it.

      regards,
      Geoff

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • geoffrey.wood@thomsonreuters.com
      ... Wait long enough, it fixes itself :) Upgraded to patches 1 - 556 and this problem has gone. Not sure if it was a bug fix or a configuration change, I
      Message 2 of 2 , Jun 21, 2012
      • 0 Attachment
        On Tuesday, 1 November 2011 14:59:22 UTC, lessthanideal wrote:
        > Using Vim 7.3 patches 1 - 333 (the Vim without Cream
        > version) on XP SP3.
        >
        > I have a dual-monitor system ...
        > ... pressing Ctrl-F12 moves the selected window between
        > the two monitors. ...
        > ... The problem is that sometimes, doing this
        > adjusts the position of horizontal splits on gvim.

        Wait long enough, it fixes itself :)

        Upgraded to patches 1 - 556 and this problem has
        gone. Not sure if it was a bug fix or a configuration
        change, I haven't knowingly changed settings in
        this area.

        regards,
        Geoff

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      Your message has been successfully submitted and would be delivered to recipients shortly.