We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c03573 commit ff195b9Copy full SHA for ff195b9
src/rewrite_clj/zip/zip.clj
@@ -154,7 +154,7 @@
154
"Inserts the item as the right sibling of the node at this loc,
155
without moving"
156
[loc item]
157
- (let [{:keys [node parent right]} loc]
+ (let [{:keys [parent right]} loc]
158
(if-not parent
159
(throw (new Exception "Insert at top"))
160
(assoc loc
test/rewrite_clj/zip/zip_test.clj
@@ -76,3 +76,9 @@
76
z/down
77
(z/replace 'x)
78
z/position) => [1 2])
79
+
80
+(fact "z/insert-right doesn't change the current position"
81
+ (-> (base/of-string "[hello world]")
82
+ z/down
83
+ (z/insert-right 'x)
84
+ z/position) => [1 2])
0 commit comments