Yukihiro Nakadaira wrote:

> v_p at last line causes error "E315: ml_get: invalid lnum"
> 
> Steps to reproduce:
> 
>   $ vim -u NONE
>   ox<Esc>ylv$p
>   E315: ml_get: invalid lnum: 2
>   E322: line number out of range: 1 past the end
> 
> This behavior was introduced by 7.4.034.
> 
> There is related another problem.
> 
>   $ vim -u NONE
>   ix<CR>y<Esc>v$d
>   :echo getline(1, '$')
>   ["x"]
> 
>   Expected: ["x", ""]
> 
> This behavior was introduce by 7.3.251.  "v$d" delete line.  I think this
> is not
> expected behavior at last line.
> 
> v_p execute 'd' and 'p'.
> 
> normal.c:nv_put()
> 9411             /* Now delete the selected text. */
> 9412             cap->cmdchar = 'd';
> 9413             cap->nchar = NUL;
> 9414             cap->oap->regname = NUL;
> 9415             nv_operator(cap);
> 9416             do_pending_operator(cap, 0, FALSE);
> 9417             empty = (curbuf->b_ml.ml_flags & ML_EMPTY);
> ...
> 9450         do_put(cap->oap->regname, dir, cap->count1, flags);
> 
> For the above behavior 'd' delete last line.  And 'p' put register to the
> line
> already deleted.  Then it causes error.
> 
> I wrote patch for this problem.  Please check the attached patch.  It revert
> 7.3.251 and add the following line.  It passes test.  But I'm not sure it
> doesn't cause another problem.

Thanks!  I'll await others to try it out.

-- 
The future isn't what it used to be.

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