Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve evil-change's handling of screen-lines #1775

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

justbur
Copy link
Member

@justbur justbur commented Apr 4, 2023

When the type is screen-line and multiple real lines are spanned, make evil-change behave like it does for the line type (e.g., by adding and indenting a new line after deletion).

Partially fixes #1407

When the type is screen-line and multiple real lines are spanned, make
evil-change behave like it does for the line type (e.g., by adding and indenting
a new line after deletion).

Partially fixes emacs-evil#1407
Copy link
Collaborator

@axelf4 axelf4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to break cc on the last continuation visual line as leftmost-point will refer to the start of the logical line.

Also what is the purpose of the (> nlines 1) check? For handling the last buffer line the special case in evil-delete needs to be extended to screen-line (e.g. 2cc).

@justbur
Copy link
Member Author

justbur commented Jun 22, 2023

(Sorry for the delay)

This seems to break cc on the last continuation visual line as leftmost-point will refer to the start of the logical line.

I'm not sure what you mean by "break". I don't see any obvious problems. Maybe you could give an example?

Also what is the purpose of the (> nlines 1) check?

The idea was that if you are in the middle of a long line that is wrapped and you select a single visual line you don't want to introduce a line break after cc. You just want to delete the corresponding text and insert something new. Note that if you delete a whole logical line, the selection covers two newline characters so you get nlines equal to 2.

For handling the last buffer line the special case in evil-delete needs to be extended to screen-line (e.g. 2cc).

Thanks, added a fix

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Certain "change-object" functions delete more than expected, including end of line
2 participants