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

Re: function virtcol() doesn't return the expected value

Expand Messages
  • H Xu
    ... Hello, I think concealed characters should not be taken into account. The document of virtcol() says: The result is a Number, which is the screen column
    Message 1 of 4 , Dec 3, 2010
    • 0 Attachment
      On 12/03/2010 03:23 PM, Christian Brabandt wrote:
      > On Thu, December 2, 2010 11:48 pm, Dominique Pellé wrote:
      >> I think that's the expected behavior. There are 2 concealed
      >> characters on line 1247. Conceal feature affects how the
      >> line is displayed but not the return value of functions such
      >> as virtcol('.').
      >>
      >> You can show the concealed char with: :set conceallevel=0
      >
      > I have not yet looked into concealing in detail. But is it expected,
      > that moving the cursor over concealed chars takes them into account?
      > For example:
      > :h editing.txt
      > 1247
      > norm! 53|
      > norm! 2l
      >
      > Note, that you need to press "l" 2 times for moving the cursor 2 chars
      > to the right, but it actually moves the cursor only one cell to the right.
      > I can understand, why this is done, but it seeems a little bit unexpected.
      >
      > regards,
      > Christian
      >
      Hello,

      I think concealed characters should not be taken into account. The
      document of virtcol() says:
      " The result is a Number, which is the screen column of the file
      position given with {expr}."

      A screen column should be returned, so virtcol() should not take the
      concealed characters into account.

      Regards,
      Hong Xu
      12/04/2010

      --
      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.