Improve support for `kill-whole-line`
Hi, thanks for making Puni, I appreciate the philosophy behind it.
One thing that’s been bothering me is that with kill-whole-line set, puni-kill-line correctly kills through \n but then puts point at the start of the next expression instead of remaining at column 0. This means the next invocation of puni-kill-line will not kill through \n, so you have to press C-k twice per line or alternate C-a and C-k as you would if kill-whole-line were unset.
I’m used to kill-whole-line enabling me to repeatedly C-k to quickly kill multiple lines, where n presses of C-k results in n killed lines.
Of course, soft deletion should take precedence. So when there is a closing delimiter on the current line, puni-kill-line should still stop there. But outside of that case, I would like puni-kill-line to keep point at column 0, so that while inside a balanced expression, each C-k kills a full line while at column 0.
Does this make any sense? Thanks!
I think I'm running into this too. Does #64 describe the behavior you're seeing?
Edit: I opened #77, since #64 is closed. Also FWIW my issue occurs regardless of the value of kill-whole-line.
This is different from the issue originally described in #64, where new indentation is created. In my case I only get point jumping to the start of the next expression, which is a result of the fix for #16. #64 was resolved by @AmaiKinono’s follow-up fix. As for your issue, I can reproduce it but I am not convinced it’s for Puni to fix. I replied about that there.
For clarification, here is an example case of the issue I’m describing, where point is |:
Start with point at column 0 and run puni-kill-line with kill-whole-line set.
hardware = {
| brillo.enable = true;
bluetooth.enable = true;
};
Expected result, so you can keep killing whole lines with repeated C-k:
hardware = {
| bluetooth.enable = true;
};
Actual result:
hardware = {
|bluetooth.enable = true;
};
I think it’s mostly reasonable to reindent as implemented in #16, but I think it’s also reasonable to not reindent if you are in column 0 with kill-whole-line set for the case where you want to rapidly kill by line.