I wrote:
> Yasuhiro Matsumoto wrote:
>
> > Copy texts into star register, like: CTRL-V jjjjll "*y,
> > getregtype() should return "^V3". On linux environment, it works fine
> > because vim seems to handle changes of clipboard.
> >
> > Below is a patch to re-calculate y_width.
> >
> > - Yasuhiro Matsumoto
> >
> > diff -r b8f703a4e55f src/ops.c
> > --- a/src/ops.c Fri Jul 04 16:43:17 2014 +0200
> > +++ b/src/ops.c Tue Jul 08 19:40:23 2014 +0900
> > @@ -906,6 +906,15 @@
> > y_current = &(y_regs[i]);
> > if (writing) /* remember the register we write into for do_put() */
> > y_previous = y_current;
> > + if (y_current->y_array != NULL && y_current->y_type == MBLOCK)
> > + {
> > + for (i = 0; i < y_current->y_size; ++i)
> > + {
> > + int width = mb_string2cells(y_current->y_array[i], -1) - 1;
> > + if (y_current->y_width < width)
> > + y_current->y_width = width;
> > + }
> > + }
> > }
>
> I'm wondering if this is the right place to do the computation. It
> should only be needed the first time the register is used, after that
> the y_width value should already be correct.
>
> Does it work to only compute y_width when "writing" is TRUE?
> Or perhaps y_width needs to be set when the register is filled
> elsewhere?
>
> Going through all the lines in the register an calling mb_string2cells()
> is quite a bit of work. It should not be done unless needed.
Also, test_eval breaks with this change.
--
ARTHUR: CHARGE!
[The mighty ARMY charges. Thundering noise of feet. Clatter of coconuts.
Shouts etc. Suddenly there is a wail of a siren and a couple of police
cars roar round in front of the charging ARMY and the POLICE leap out and
stop them. TWO POLICEMAN and the HISTORIAN'S WIFE. Black Marias skid up
behind them.]
HISTORIAN'S WIFE: They're the ones, I'm sure.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// 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.