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

Re: Automatic scrollbar causes column growth

Expand Messages
  • John Little
    ... My vim 7.3.820 on Kubuntu misbehaves much more than yours. All I have to do is press the space bar once, then away it goes, getting wider and wider, a
    Message 1 of 5 , Feb 23, 2013
    • 0 Attachment
      On Sunday, February 24, 2013 2:15:47 AM UTC+13, Michael Henry wrote:

      > Each time the spacebar is pressed, the value of 'columns' will be
      > displayed at four points in time.

      My vim 7.3.820 on Kubuntu misbehaves much more than yours. All I have to do is press the space bar once, then away it goes, getting wider and wider, a little unsteadily, till it reaches the width of my display, 237, where it bounces erratically between 237 and 238.
      If I change the map to noremap, or map a key not used in the mapping, the looping does not occur, and gvim's behaviour becomes predictable, in that the columns always go up by 1 in the fourth number. Now clearly gvim is looping for me with a recursive map, which shouldn't happen, because :map mappings don't apply on the command line, :map! ones do.

      If I start gvim -u NONE -N, and run :wincmd v then :wincmd o, the window size doesn't increase. But :wincmd v | windcmd o increases the width by one.

      It seems that after "wincmd v" gvim is confused as to what state it is in.

      Regards, John Little

      --
      --
      You received this message from the "vim_dev" 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 because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Michael Henry
      ... It sounds like you ve got a stray space character at the end of the :map command. I can replicate your results if I put a trailing space after the .
      Message 2 of 5 , Feb 24, 2013
      • 0 Attachment
        On 02/23/2013 07:16 PM, John Little wrote:
        > On Sunday, February 24, 2013 2:15:47 AM UTC+13, Michael Henry wrote:
        >
        >> Each time the spacebar is pressed, the value of 'columns' will be
        >> displayed at four points in time.
        >
        > My vim 7.3.820 on Kubuntu misbehaves much more than yours.
        > All I have to do is press the space bar once, then away it
        > goes, getting wider and wider, a little unsteadily, till it
        > reaches the width of my display, 237, where it bounces
        > erratically between 237 and 238.
        > If I change the map to noremap, or map a key not used in the
        > mapping, the looping does not occur, and gvim's behaviour
        > becomes predictable, in that the columns always go up by 1 in
        > the fourth number.

        It sounds like you've got a stray space character at the end of
        the :map command. I can replicate your results if I put a
        trailing space after the <CR>. I should have used :nnoremap
        instead of :map to avoid this kind of problem.

        > Now clearly gvim is looping for me with a
        > recursive map, which shouldn't happen, because :map mappings
        > don't apply on the command line, :map! ones do.

        I think this is explained by the fact that Vim goes back to
        normal mode after executing the ``:call TestColumns()<CR>`` part
        of the mapping.

        > If I start gvim -u NONE -N, and run :wincmd v then :wincmd o,
        > the window size doesn't increase. But :wincmd v | windcmd o
        > increases the width by one.

        Yes, there is definitely a timing component to this, which is
        why it fails only some of the time for me.

        Thanks for the verification. With a timing-dependent problem,
        it's not always a given that everyone can replicate it.

        Michael Henry

        --
        --
        You received this message from the "vim_dev" 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 because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • John Little
        ... Yes, you re right. If I paste text into vim from firefox, and the text does not end with a period or a newline, a space is appended :/, never noticed that
        Message 3 of 5 , Feb 24, 2013
        • 0 Attachment
          On Monday, February 25, 2013 2:18:02 AM UTC+13, Michael Henry wrote:
          > It sounds like you've got a stray space character at the end of
          > the :map command.

          Yes, you're right. If I paste text into vim from firefox, and the text does not end with a period or a newline, a space is appended :/, never noticed that before. I do sort of recall other posters on this list having stray spaces on the ends of mappings, perhaps this was the cause. Sorry to muddy your thread.

          Having fixed this, I do not see your unpredictability problem, all messages have the first three numbers the same (until the screen width is reached).

          Regards, John Little

          --
          --
          You received this message from the "vim_dev" 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 because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Charles Campbell
          ... Hello! Just wanted to note that I was able to duplicate something of this issue (using Scientific Linux 6.3). I hit space a lot, held it down a bit, etc.
          Message 4 of 5 , Mar 1, 2013
          • 0 Attachment
            Michael Henry wrote:
            > All,
            >
            > By default in Gvim, creating or destroying a vertical split
            > causes the left-side scrollbar to automatically be created or
            > destroyed. There appears to be some kind of timing-related bug
            > wherein Gvim is not always able to maintain the value of
            > 'columns' at its original value.
            >
            > To demonstrate this, save the following snippet of VimL as
            > ``scrollbar-column-growth.vim``::
            >
            > function! TestColumns()
            > let c1=&columns
            > wincmd v
            > let c2=&columns
            > wincmd o
            > let c3=&columns
            > sleep 250m
            > echomsg c1 c2 c3 &columns
            > endfunction
            > map <silent> <Space> :call TestColumns()<CR>
            >
            > Then, invoke Gvim as::
            >
            > gvim -u NONE '+set nocp | source scrollbar-column-growth.vim'
            >
            > Each time the spacebar is pressed, the value of 'columns' will be
            > displayed at four points in time. The first and last values show
            > the initial and final 'columns' values. The bug doesn't always
            > manifest itself with each keypress, but when the bug occurs, the
            > final 'columns' value will have grown larger than the initial value.
            >
            > Try pressing spacebar multiple times in a row, then looking at
            > the resulting :messages. Here is a sample run::
            > 80 80 80 80
            > 80 80 80 80
            > 80 80 82 82
            > 82 82 84 84
            > 84 84 86 86
            > 86 86 88 86
            > 86 86 86 86
            > 86 86 86 88
            >
            > As you can see, sometimes the 'columns' value is always correct,
            > sometimes it goes up and comes back down (e.g., ``86 86 88
            > 86``), and sometimes it goes up permanently.
            >
            > I can work around the problem by removing the default ``L`` in
            > 'guioptions'; the bug manifests only when a scrollbar is setup
            > to appear automatically using ``L`` or ``R``.
            >
            > This test was done on Fedora 17 Linux with a self-compiled Vim
            > with :version output shown after my signature, but this is a
            > problem that have been around for a long time (years, I think,
            > but I've only just now isolated it to a somewhat repeatable
            > test).
            >
            Hello!

            Just wanted to note that I was able to duplicate something of this issue
            (using Scientific Linux 6.3).
            I hit space a lot, held it down a bit, etc. I'd get straight 189s, then
            after quite a bit, I got 191s.

            Regards,
            Chip Campbell

            --
            --
            You received this message from the "vim_dev" 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 because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          Your message has been successfully submitted and would be delivered to recipients shortly.