We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Version version 1.1.48
Symptom Cannot slurp or barf, forward or backward in a syntax quoted element | indicating the cursor, see:
|
[:left '[foo| bar] :right]
Related is trying to slurp forward from:
@(def | x) 42
Actual behavior assertion error is thrown
Diagnosis assertion error is inside QuoteNode creation
Action I know that there has been discussion in a separate thread about asserts; but here it looks to be harmful to the cause.
BTW: Thanks for the great library. It is adding paredit functionality to repl-balance (an update of rebel-readine)
The text was updated successfully, but these errors were encountered:
Thanks for the issue @openvest, I'm happy to see that folks are starting to use the paredit API more.
Here's my repro of your issue:
(require '[rewrite-clj.paredit :as par] '[rewrite-clj.zip :as z]) ;; navigate to foo and slurp forward (def zloc (-> "[:left '[foo bar] :right]" z/of-string z/down z/right z/down z/down)) (z/string zloc) ;; => "foo" (par/slurp-forward zloc) ;; => Execution error (AssertionError) at rewrite-clj.node.protocols/assert-sexpr-count (protocols.cljc:177). ;; Assert failed: can only contain 1 non-whitespace form. ;; (= (count (without-whitespace nodes)) c)
Very good, I can reproduce!
Let's retry without a quoted node to see what happens:
;; repeat with non-quoted ;; navigate to foo (def zloc (-> "[:left [foo bar] :right]" z/of-string z/down z/right z/down)) (z/string zloc) ;; => "foo" (-> zloc par/slurp-forward z/root-string) ;; => "[:left [foo bar :right]]"
Good, no probs without quoted node.
I had launched into reviewing the paredit API with various fixes, but got distracted by other projects. This one is new to me, so thanks for sharing!
Sorry, something went wrong.
No branches or pull requests
Version
version 1.1.48
Symptom
Cannot slurp or barf, forward or backward in a syntax quoted element
|
indicating the cursor, see:Related is trying to slurp forward from:
Actual behavior
assertion error is thrown
Diagnosis
assertion error is inside QuoteNode creation
Action
I know that there has been discussion in a separate thread about asserts; but here it looks to be harmful to the cause.
BTW: Thanks for the great library. It is adding paredit functionality to repl-balance (an update of rebel-readine)
The text was updated successfully, but these errors were encountered: