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

fix: the vi-paste-before command in line-mode at the last line should open a newline before current line. #1671

Merged

Conversation

sakurawald
Copy link
Contributor

@sakurawald sakurawald commented Dec 3, 2024

This commit fix the edge case when vi-paste a line before at the last line.

Taken this example buffer

first
second
third1 th[i]rd2 third 3

If current-line is at the last line, then the vi-paste-before command in line-mode should open a new line above current-line.


The keypoint is that: The last line doesn't contains the line-break character, so it's an edge-case.

@sakurawald
Copy link
Contributor Author

sakurawald commented Dec 3, 2024

This commit still can't pass the continous paste before case.
If in line-mode paste, the paste string contains a line-break character, this line-break character introduces the difference between the last line and not the last line.

@sakurawald
Copy link
Contributor Author

sakurawald commented Dec 3, 2024

The vi-paste-before and vi-paste-after commands works well, if current line is not the last line.

An exapmle buffer is:

first
second
third1 th[i]rd2 third 3
end

@sakurawald
Copy link
Contributor Author

The vi-yank-line command, behaves differently on the last line and not the last line.
In not the last line, the line-break character is copied.
In the last line, the line-break character is not copied.

@cxxxr cxxxr merged commit e04b45b into lem-project:main Dec 3, 2024
2 checks passed
@sakurawald sakurawald deleted the vi-paste-line-before-at-last-line branch December 4, 2024 19:30
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