You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose an (optional?) special case rule to block Paredit from removing any whitespace (or at least newlines) directly to the left of the cursor. Bonus if manually triggering format ignores the special case.
Why
Example cases (|represents cursor, not pipe char.) :
(defnfoo (|))
;; type backspace;; ==>
(defnfoo|)
(defnfoo
(|))
;; type backspace;; ==>
(defnfoo|)
My next action in these examples will be typing [ in place of an accidentally typed (. But whitespace gets collapsed, so instead of ( I must type Space>[ or Enter[.
The extra keystroke is of minimal importance. The problem here is the jarring movement of the cursor and loss of immediate context. This is especially disorienting in cases that collapse empty line(s).
Another example :
(let [fooooooooooooooooo {:a"a"}
bar [|]])
;; type backspace;; ==>
(let [fooooooooooooooooo {:a"a"}
bar|])
In this example the added keystrokes are important. I have already done extra work to carefully align the left bracket with the brace above it. Pressing Backspace wipes all that away. (Plus I have to use Space to fix it, because Calva hijacked Tab.)
The text was updated successfully, but these errors were encountered:
Iirc there is some code used by the backspace Paredit function that possibly can be put in use for this purpose as well. It might be a matter of recognizing the situation and skip post-edit formatting.
As for the bonus. If it is ”just” skipping post-edit, then we'll get the bonus for free. And if it is a matter of tweaking the formatting, it today considers if the formatting is happening as-you-type or on-demand, so this case can probably be handled there.
I propose an (optional?) special case rule to block Paredit from removing any whitespace (or at least newlines) directly to the left of the cursor. Bonus if manually triggering format ignores the special case.
Why
Example cases (
|
represents cursor, not pipe char.) :My next action in these examples will be typing [ in place of an accidentally typed (. But whitespace gets collapsed, so instead of ( I must type Space> [ or Enter [.
The extra keystroke is of minimal importance. The problem here is the jarring movement of the cursor and loss of immediate context. This is especially disorienting in cases that collapse empty line(s).
Another example :
In this example the added keystrokes are important. I have already done extra work to carefully align the left bracket with the brace above it. Pressing Backspace wipes all that away. (Plus I have to use Space to fix it, because Calva hijacked Tab.)
The text was updated successfully, but these errors were encountered: