emacs-evil / emacs-evil/evil

'at' and 'it' motions for working with tags doesn't behave similar to vim

Open
#1,815 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
3.9k
Forks
307
PR merge metrics
No merged PRs in 30d

Description

# Issue type
Issue with core feature of vim, changing and deleting text between tags

- Bug report

# Environment

Emacs version: 28.2 (Build 2 x86_64-w64-mingw32) of 2022-09-13
Operating System: Windows 10
Evil version: evil-git-477807f
Evil installation type: ELPA
Graphical/Terminal: graphical
Tested in a `make emacs` session (see [CONTRIBUTING.md](https://github.com/emacs-evil/evil/blob/master/CONTRIBUTING.md#bug-reports)): No
# Reproduction steps
- Start Emacs
- Copy and paste following text into any buffer.
- When label tag has value
- ```


test


```
- When label tag is empty
- ```




```
- Please, apply cit commands on scenario as mentioned below

# Expected behavior
When using command such as cit and dit.

Scenario 1: the cursor is at the start of line (using 0 shortcut)
When there is no text between tags, and the cursor is at the start of line (using 0 shortcut).
Evil mode deletes the parent tag.
Though vim jumps the cursor between the tag
(VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Oct 25 2020 11:44:06)

Assume `**|**` to be the cursor for demonstration purposes.

Originally cursor is the pipe - ` **|** `
Expected cursor is the pipe - ` **|**` after cit

Scenario 2: the cursor is at the start of tag
Evil mode deletes the parent tag.
Though vim jumps the cursor between the tag
(VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Oct 25 2020 11:44:06)

Assume pipe to be the cursor
Originally cursor is the pipe - ` <**|** label for="edit">`
Expected cursor is the pipe - ` **|**` after cit

# Actual behavior
While running for scenario 1
1. When at start of the line using 0 shortcut, the entire tag and other child element are deleted.

While running for scenario 2

1. If there is no text and the cursor is in tag, entire line gets deleted.
` <**|**label for="edit">`

2. When the cursor is at start of the line and no text is provided, entire line gets deleted.
(using 0 shortcut) ` **|** `

3. If there is text between tag and cursor is at the start of line (again using 0 shortcut) still the entire line gets deleted.
` **|** text`

4. When cursor is at the tag, and tag has some text. When cit is pressed, the line works as expected.

# Further notes

Contributor guide

Open the contributing guide

Research direction

Reproduce the cit and dit cases in Emacs 28.2 on Windows 10 using the empty and nonempty label examples, including both cursor positions. Read CONTRIBUTING.md's bug-report guidance, then compare each result with Vim; done means the parent tag and surrounding content are preserved and the cursor lands between the tags as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs-lisp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.