Christian Ludwig wrote:

> Bram Moolenaar wrote:
> >
> > Thanks for explaining.  So the '] mark is on the last byte of the
> > yanked text.  I hesitate to change this, since quite a few Vim
> > functions with byte positions, and the number of bytes between '[ and
> > '] could be used.
> >
> > So we can change virtcol().  I'll make a patch for that.
> >
> 
> Thank you. Patch 8.0.250 fixes (only) the first 3 examples/test cases of
> 
> https://github.com/vim/vim/issues/277#issuecomment-274372013
> 
> but unfortunately not the last 2 examples.
> 
> Yanking the first 3 visual columns [1,3] of
> 😀a
> a😀
> the output of
> :echo [virtcol("'["),virtcol("']")]
> is [2,3] and [1,4] respectively.

That is correct.  For the double-wide character the position of the
right half is given, as documented:

        That is, the last screen position occupied by the character at
        that position, when the screen would be of unlimited width.
        When there is a <Tab> at the position, the returned Number will
        be the column at the end of the <Tab>.

-- 
We learn from our mistakes.  Politicians don't make mistakes.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui