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 and refactor kill whole line #1642

Conversation

SequentialDesign
Copy link
Contributor

sorry, again, about all the github trouble. i'll study git in the next days so that my requests are not redundant.

at present, Lem's kill-whole-line kills the line and then does delete-previous-char, which seems wrong. this patch makes kill-whole-line, one, kill the entire line, including the new line at the end of a line if indeed there is one, and, two, allow it to be prefixed.

|;; one one one
;; two two two
;; three three three
;; four four four
;; five five five

(| is point) if 5 kill-whole-line, all lines are deleted.

;; one one one
;; two two two
;; three three |three
;; four four four
;; five five five

(| is point) if 0 kill-whole-line, nothing happens.

;; one one one
;; two two two
;; three three |three
;; four four four
;; five five five

(| is point) if -2 kill-whole-line, ";; one one one" and ";; two two two" are deleted, and the point stays right before the last "three". if you want to delete the previous "three"s, then you can use the kill command.

i'm curious if others agree with me

SequentialDesign and others added 3 commits November 26, 2024 14:59
update point after backspacing and yanking while isearch is active

|
;; one test is what you need

(| is the point) with this patch, if you search for "ee" and then backspace, the point will move to the end of the word "one".   in Lem currently, if you search for "ee" and then backspace, the point will stay after "ee", when I feel it should be at the end of "one" since the search string has changed.  this patch also works when reverse searching 

|
;; one test is what you need

(| is the point)  with this patch, if  "one test" is the current kill string and you yank, the point will move to after "one test".  in Lem currently, the point will not move after yanking, which i don't think is natural
…ghting`. the keybinds feel very natural, and having the command available to the user as a default keybind seems user-friendly to me.

i apologize for not knowing git and if this creates conflicts in case you don't accept my previous pull requests involving updating the point during isearch on backspace and yank.  i'm a pure beginner with git, but i will continue to get better at it
…ete-previous-char`, which seems wrong. this patch makes `kill-whole-line`, one, kill the entire line, including the new line at the end of a line if indeed there is one, and, two, allow it to be prefixed.

|;; one one one
;; two two two
;; three three three
;; four four four
;; five five five

(| is point) if `5 kill-whole-line`, all lines are deleted.

;; one one one
;; two two two
;; three three |three
;; four four four
;; five five five

(| is point) if `0 kill-whole-line`, nothing happens.

;; one one one
;; two two two
;; three three |three
;; four four four
;; five five five

(| is point) if `-2 kill-whole-line`, ";; one one one" and ";; two two two" are deleted, and the point stays right before the last "three".  if you want to delete the previous "three"s, then you can use the `kill` command.

i'm curious if others agree with me
@SequentialDesign
Copy link
Contributor Author

going to close this one, and make another one. my code feels wrong, but i hope you'll have patience with me.

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.

1 participant