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

Re: Bug in win_lbr_chartabsize()?

Expand Messages
  • Bram Moolenaar
    ... The code hasn t been tested much with tabstop set to values other than 8. But it should work. I can see the problem you explain. Hopefully you can fix
    Message 1 of 4 , Oct 1, 2007
    • 0 Attachment
      Matthew Winn wrote:

      > I've been digging through the Vim source and had trouble trying to
      > understand what win_lbr_chartabsize() is doing. About 112 lines from
      > the start of the function (in 7.1.94) there's a part that should take
      > the width of a tab into account when used in combination with
      > "showbreak". I couldn't work out how these parts were supposed to
      > interact from studying the code so I tried studying Vim's behaviour
      > instead. The results are a bit odd.
      > Create a file with a line containing a repeating pattern of four
      > letters and a tab (that is, "abcd<tab>abcd<tab>abcd<tab>...") to a
      > width of about 300 columns. Then set wrap, showbreak=>>> and tabstop
      > to something like 9 so there aren't a even number of tabs in your
      > screen width or your screen width less the width of the showbreak.
      > Now, starting from the beginning of the line, press w repeatedly
      > and watch where the cursor goes after each movement. On some of the
      > wrapped lines I see it settle three characters to the left of where it
      > should be when it moves to the first word on each wrapped screen line.
      > I've tried to fix it, but no matter what I change the cursor always
      > lands in the wrong place at some point. Does anyone else see this?

      The code hasn't been tested much with 'tabstop' set to values other than
      8. But it should work.

      I can see the problem you explain. Hopefully you can fix it, but I'll
      put it somewhere in my todo list.

      SECOND SOLDIER: It could be carried by an African swallow!
      FIRST SOLDIER: Oh yes! An African swallow maybe ... but not a European
      swallow. that's my point.
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
    Your message has been successfully submitted and would be delivered to recipients shortly.