On Di, 17 Sep 2019, Bram Moolenaar wrote:

> Patch 8.1.2052
> Problem:    Using "x" before a closed fold may delete that fold.
> Solution:   Do not translate 'x' do "dl". (Christian Brabandt, closes #4927)
> Files:            src/normal.c, src/testdir/test_fold.vim

Quoting from the related issue:

> Thanks.  But the line should still be deleted, thus in this case the
> translated operation is "dd".

I am not sure I agree.

I did intentionally not delete the line. My idea was, that `x` on an
empty line (or after a newline [e.g. with `:set
virtualedit=onemore`]) should be a no-op and the `whichwrap` option 
should not apply to it, since the user did not type `dl`.

And because there is no character after the cursor I think that `x` 
should not do anything (just like `x` on an empty line with a default 
whichwrap setting).

In fact, the new behaviour will now delete a line, e.g. with

:set ww+=l virtualedit=onemore list listchars=eol:$

one a line like this and the cursor on the End-of-line marker ($):

    abcd$

pressing x on this will now delete the line and this is rather unexpected.

In fact, if we are going to translate `x` to `dd` in that case, we 
probably should do the same for `X` when `h` is in whichwrap.

But I still think this is wrong.

What do you think? I can make a patch either way.

Best,
Christian
-- 
Eine fortschrittliche Frau fortgeschrittenen Alters kann keine Macht
der Welt im Zaum halten.
                -- Dorothy L. Sayers

-- 
-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20190918064431.GJ30959%40256bit.org.

Raspunde prin e-mail lui