AmaiKinono / puni

Structured editing (soft deletion, expression navigating & manipulating) that supports many major modes out of the box.
GNU General Public License v3.0
403 stars 21 forks source link

`puni-kill-line` doesn't 100% respect `kill-whole-line` #55

Closed slotThe closed 1 year ago

slotThe commented 1 year ago

Quoting from the documentation of kill-line:

If option kill-whole-line is non-nil, then this command kills the whole line including its terminating newline, when used at the beginning of a line with no argument.

The "at the beginning of a line" is the important bit here. kill-line ensures this by checking (and kill-whole-line (bolp)), while puni-kill-line only checks kill-whole-line itself. This seems like a mistake (though I can't be sure, hence this is an issue rather than a pull request), and results—in my opinion—in surprising results; let | be the cursor:

This |is a line.
This is another line.

;; kill-line
This
This is another line.

;; puni-kill-line
This This is another line.

I'm happy to open a PR if this is unintentional, or you can make the change yourself; whatever you prefer.