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

When wiping last line, don't add newline. #7

Merged
merged 2 commits into from
Apr 27, 2023

Conversation

bjornbm
Copy link
Contributor

@bjornbm bjornbm commented Apr 27, 2023

The fixes a weirdness where wiping the last line is not undone by a
single ^Z, due to the newline insertion being a separate event in the
undo action list (b.ual). Thus, to get back to the state prior to a wipe
of the last line, two undos were required.

With this modification, the behavior when wiping the last line is
slightly modified. Specifically, the wipe does not include a newline at
the end (after all, there was no newline to wipe in the first place). As
a consequence, when yanking the wiped line, there we will also be no
newline at the end of the insert.

For precedence, this is consistent with the emacs ^K on the last line
(even if wipe behavior is not in general identical to ^K).

bjornbm added 2 commits April 27, 2023 08:29
Problem fixed: Insert a newline at cj>1. Undo (^Z). The undo operation
removes cj-1 characters following the point of the insertion.
The fixes a weirdness where wiping the last line is not undone by a
single ^Z, due to the newline insertion being a separate event in the
undo action list (b.ual). Thus, to get back to the state prior to a wipe
of the last line, two undos were required.

With this modification, the behavior when wiping the last line is
slightly modified. Specifically, the wipe does not include a newline at
the end (after all, there was no newline to wipe in the first place). As
a consequence, when yanking the wiped line, there we will also be no
newline at the end of the insert.

For precedence, this is consistent with the emacs ^K on the last line
(even if wipe behavior is not in general identical to ^K).
@bjornbm bjornbm changed the title wipelast When wiping last line, don't add newline. Apr 27, 2023
@philanc philanc merged commit a169d07 into philanc:master Apr 27, 2023
@philanc
Copy link
Owner

philanc commented Apr 27, 2023

Applied. Thanks!

@bjornbm bjornbm deleted the wipelast branch May 7, 2023 19:37
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