Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Visual line motions are screen-line motions #1890

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aaronjensen
Copy link
Contributor

Operations like dj do not work as expected when evil-respect-visual-line-mode is t. It deletes to where the j motion would go, rather than deleting the current line and the next line.

This change makes them work, but I do not know what other impact it may have. Any guidance on testing or accomplishing this in another way would be appreciated. Thank you.

@axelf4
Copy link
Collaborator

axelf4 commented Apr 25, 2024

The line type is not right here - will that not make them operate on logical lines? Instead, could you try changing to the screen-line type?

@aaronjensen
Copy link
Contributor Author

That seems to work too. I don't know the difference between the two. Aren't visual lines logical lines? Or does that mean something else?

@aaronjensen aaronjensen force-pushed the visual-line branch 2 times, most recently from a3e0b21 to 0dff71d Compare April 25, 2024 18:06
@aaronjensen aaronjensen changed the title Visual line motions are line motions Visual line motions are screen-line motions Apr 25, 2024
@axelf4
Copy link
Collaborator

axelf4 commented Apr 25, 2024

In Emacs terminology a single logical line (terminated by a \n) can be soft-wrapped as several visual lines.1

Footnotes

  1. https://www.gnu.org/software/emacs/manual/html_node/emacs/Visual-Line-Mode.html

@aaronjensen
Copy link
Contributor Author

Ah, not what I expected "logical" to mean. Thanks. I updated the PR.

@aaronjensen
Copy link
Contributor Author

@axelf4 does this one look OK? anything else I should update?

@aaronjensen aaronjensen marked this pull request as draft September 12, 2024 18:54
@aaronjensen aaronjensen marked this pull request as ready for review September 12, 2024 18:55
@aaronjensen
Copy link
Contributor Author

@axelf4 friendly reminder on this one. If there's anything I can change on it, let me know. I've been using it now for several months and it's worked just fine.

Thanks.

@aaronjensen
Copy link
Contributor Author

Hi @tomdl89 would you by chance be able to take a look at this PR and consider merging it? I noticed you were working on related visual line features. I hope you don't mind the mention.

@axelf4
Copy link
Collaborator

axelf4 commented Dec 14, 2024

Looking into it, using screen-line is only correct when evil-respect-visual-line-mode and visual-line-mode are both non-nil, otherwise it behaves like line. An unconditional version of the screen-line type is needed, but screen-line instead of exclusive is still a big improvement. I am not against this PR being merged as-is.

@aaronjensen
Copy link
Contributor Author

@axelf4 Sounds good.

Could you give an example of problematic behavior when either evil-respect-visual-line-mode or visual-line-mode are disabled?

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

Successfully merging this pull request may close these issues.

2 participants