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
Copy file name to clipboardExpand all lines: doc/01-user-guide.adoc
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -437,12 +437,12 @@ Let's explore:
437
437
[#position-tracking]
438
438
==== Tracking Position with the Zip API
439
439
440
-
If you need to track the source row and column while reading and updating your zipper, create your zipper with `:track-position true` option.
440
+
If you need to track the source row and column while reading and updating your zipper, create your zipper with `:track-position? true` option.
441
441
Note that the row and column are 1-based.
442
442
443
443
[TIP]
444
444
====
445
-
If you have no interest in the zipper updating positions when the zipper changes, but are still interested in node positions, you can use a zipper without `:track-positon true` option.
445
+
If you have no interest in the zipper updating positions when the zipper changes, but are still interested in node positions, you can use a zipper without `:track-position? true` option.
446
446
447
447
Read up on positional metadata under link:#nodes[rewrite-clj nodes].
448
448
====
@@ -510,7 +510,7 @@ When creating a new zipper you may optionally include an options map.
510
510
These options will be carried by the zipper and live for the life of the zipper.
511
511
Current options are:
512
512
513
-
* `:track-position` - see <<position-tracking>>
513
+
* `:track-position?` - see <<position-tracking>>
514
514
* `:auto-resolve` - see <<custom-auto-resolve>>
515
515
516
516
After making changes via a zipper, the final step is typically to call `root-string` or `print-root`.
@@ -524,10 +524,9 @@ The options passed into the original zipper on creation will not be automaticall
524
524
(require '[rewrite-clj.zip :as z])
525
525
526
526
;; some contrived options to demonstrate:
527
-
(def zip-opts {:track-position true
527
+
(def zip-opts {:track-position? true
528
528
:auto-resolve (fn [_alias] 'custom-resolved)})
529
529
530
-
531
530
(-> "(+ 10 20 30)" ;; <- something more complicated would be here, of course
532
531
(z/of-string zip-opts) ;; <- our opts are passed in on creation
Copy file name to clipboardExpand all lines: doc/design/01-merging-rewrite-clj-and-rewrite-cljs.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -697,6 +697,6 @@ We:
697
697
I personally prefer the map notation, but, as a rule, favor rewrite-clj v0 over rewrite-cljs because rewrite-clj v0 is the more widely used library and thus changes affect more users.
698
698
3. include rewrite-cljs's positional functions: `rewrite-clj.zip/find-last-by-pos` and `rewrite-clj.zip/find-tag-by-pos`.
699
699
700
-
The most glaring breaking change for ClojureScript is that it must now create the zipper with positional support enabled, for example: `(z/of-string "[1 2 3]" {:track-position true})`
700
+
The most glaring breaking change for ClojureScript is that it must now create the zipper with positional support enabled, for example: `(z/of-string "[1 2 3]" {:track-position? true})`
701
701
702
702
=== link:namespaced-elements.adoc[Namespaced maps and keywords]
0 commit comments