Christian Brabandt wrote:
> On Do, 17 Mär 2011, Bram Moolenaar wrote:
>
> > If you do gH<Del> it deletes the line. It's only on the last line that
> > it makes the line empty. Let's call that a bug.
> >
> > Someone who wants to fix this?
>
> diff --git a/src/normal.c b/src/normal.c
> --- a/src/normal.c
> +++ b/src/normal.c
> @@ -1776,6 +1776,11 @@
> ++oap->line_count;
> }
> }
> + if ( VIsual_select
> + && ( cap->nchar == 'H' || (oap->start.col == 0
> + && oap->end.col ==
> (colnr_T)STRLEN(ml_get(oap->end.lnum))-1))
> + && *p_sel != 'o')
> + oap->motion_type = MLINE;
> }
>
> redo_VIsual_busy = FALSE;
>
> That also fixes the bug, that when you select a whole line with the
> mouse and press delete, the line is left empty.
Thanks. I wonder why gH doesn't set the motion to linewise anyway. If
you do gH<Del> in any line but the last it already deletes the whole
line. Your patch doesn't check the line number, while it was only wrong
in the last line. So perhaps it needs to be solved elsewhere?
--
Snoring is prohibited unless all bedroom windows are closed and securely
locked.
[real standing law in Massachusetts, United States of America]
/// 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