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

Re: How to get updated winwidth() after :set guifont ?

Expand Messages
  • Zhao Cai
    Thank for your answer, Björn and Tony! Now I understand the reason for this behavior. I will figure something out… Zhao ... -- You received this message
    Message 1 of 5 , Jan 2, 2012
    • 0 Attachment
      Thank for your answer, Björn and Tony! Now I understand the reason for this behavior. I will figure something out…

      Zhao

      On Jan 2, 2012, at 12:58 PM, björn wrote:

      > 2012/1/2 Tony Mechelynck:
      >> I'm redirecting this thread to the vim_mac group and adding Björn to the CC.
      >
      > Thanks for bringing this to my attention Tony.
      >
      >> On 02/01/12 03:33, Zhao Cai wrote:
      >>>>
      >>>> On 01/01/12 16:37, Zhao Cai wrote:
      >>>>>
      >>>>> Problem: Right after `set guifont=…`, `winwidth()` returns the old win
      >>>>> width instead of the new width which would be changed by new guifont size.
      >>>>>
      >>>>> I tried to call `redraw` between but it does not work.
      >>>
      >>> I just retested a few more times. The problem happens only when I use mac
      >>> lion's native full screen. For normal full screen, the winwidth function
      >>> works just fine.
      >
      > MacVim is a multiprocess application where core Vim runs in one
      > process and the MacVim GUI runs in another. When you call ":set
      > gfn=..." this causes an IPC message to be (asynchronously) sent to the
      > GUI which will then resize its window appropriately and then send
      > another message back to the Vim process telling it what the new window
      > size should be in order to fit on the screen.
      >
      > Hence, if you try to get the window width right after setting 'gfn' it
      > will still tell you the old value because the IPC message that tells
      > Vim about the updated window dimensions have yet to arrive.
      >
      > Fixing this problem will require a redesign to how MacVim resizes
      > windows, which is difficult I'm afraid. I'd suggest you try to find
      > other ways around this problem.
      >
      > Björn
      >
      > --
      > You received this message from the "vim_mac" 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

      --
      You received this message from the "vim_mac" 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
    • John Beckett
      ... If desperate, consider :sleep with a value that usually works. John -- You received this message from the vim_mac maillist. Do not top-post! Type your
      Message 2 of 5 , Jan 2, 2012
      • 0 Attachment
        Zhao Cai wrote:
        > Thank for your answer, Björn and Tony! Now I understand the
        > reason for this behavior. I will figure something out…

        If desperate, consider :sleep with a value that usually works.

        John

        --
        You received this message from the "vim_mac" 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
      • Zhao Cai
        Thanks! John, :sleep does work. ... -- You received this message from the vim_mac maillist. Do not top-post! Type your reply below the text you are replying
        Message 3 of 5 , Jan 2, 2012
        • 0 Attachment
          Thanks! John, :sleep does work.

          On Jan 2, 2012, at 6:53 PM, John Beckett wrote:

          > Zhao Cai wrote:
          >> Thank for your answer, Björn and Tony! Now I understand the
          >> reason for this behavior. I will figure something out…
          >
          > If desperate, consider :sleep with a value that usually works.
          >
          > John
          >
          > --
          > You received this message from the "vim_mac" 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

          --
          You received this message from the "vim_mac" 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.