emacs-evil / evil

The extensible vi layer for Emacs.
GNU General Public License v3.0
3.39k stars 280 forks source link

'cw' and 'dw' fail to delete when point is at the last character of an eshell command #863

Open Ambrevar opened 7 years ago

Ambrevar commented 7 years ago

Issue type

Environment

Emacs version: 25.2 Operating System: Arch Linux Evil version: 1.2.12 Evil installation type: MELPA Graphical/Terminal: Graphical Terminal multiplexer: N?A

Reproduction steps

(Or dw)

Expected behavior

c should be killed.

Actual behavior

It remains after point.

wasamasa commented 7 years ago

This is not an eshell-related bug, you can repro it in a much easier way

The problem is that the buffer doesn't end with a final newline which would permit this operation. The why needs closer investigation.

edit: The why seems to be linked to word movement. If you attempt to move with point on the last letter without a final newline, the cursor doesn't move, instead you get an "End of buffer" error. With the final newline, cursor moves by one, which happens to describe the range of cw and dw.

justbur commented 7 years ago

This is dependent on evil-move-beyond-eol and evil-move-cursor-back. I have them as the non-default values and this works fine for me.

wasamasa commented 7 years ago

Hm, but should it be? Vim does the right thing here, no matter whether there's a final newline, the last character can be deleted/changed this way.

justbur commented 7 years ago

I wasn't denying that it was a bug, just providing more information