emacs-evil / evil

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

Tags misalign when editing heading in org-mode #1264

Open some-mthfka opened 4 years ago

some-mthfka commented 4 years ago

Issue type

Environment

Emacs version: 26.3 Operating System: arch linux Evil version: evil-git-874beba Evil installation type: Graphical/Terminal: graphical Tested in a make emacs session (see CONTRIBUTING.md): yes

Reproduction steps

when editing the title, you will see that adding characters preserves the alignment of the tags; removing characters breaks the alignment.

In vanilla emacs the alignment is always preserved.

some-mthfka commented 4 years ago

a similar thing happens when editing table cells

duianto commented 3 years ago

Tags move

insert state

 <backspace>        ;; evil-delete-backward-char-and-join

normal and visual state

 <delete>       ;; evil-delete-char
 c          ;; evil-change
 d          ;; evil-delete
 s          ;; evil-substitute
 x          ;; evil-delete-char
 X          ;; evil-delete-backward-char

emacs state (C-z)

 <delete>       ;; delete-forward-char

Tags remain aligned

insert state

 <delete>       ;; org-delete-char

emacs state (C-z)

 <backspace>        ;; org-delete-backward-char

Opposite behavior

In at least one case, Evil behaves as expected, while vanilla Emacs moves the tags.

The tags don't move when pressing delete in insert state:

 <delete>       ;; org-delete-char

\ runs the command org-delete-char (found in org-mode-map), which is an interactive compiled Lisp function in ‘org.el’.

It is bound to \.

(org-delete-char N)

But they move in vanilla Emacs:

 <delete>          ;; delete-forward-char

\ (translated from \) runs the command delete-forward-char (found in global-map), which is an interactive compiled Lisp function in ‘simple.el’.

It is bound to \.

(delete-forward-char N &optional KILLFLAG)

Both when Emacs is started with:

The Evil config (Evil version 1.14.0) uses the default Emacs 27.2, org version: Org mode version 9.4.4 (release_9.4.4 @ c:/Program Files/Emacs/x86_64/share/emacs/27.2/lisp/org/)

The above was tested with:

GNU Emacs 27.2 (build 1, x86_64-w64-mingw32) of 2021-03-26
Windows 10 Version 2004