Skip to content

Commit fd518e2

Browse files
committed
docs: typos: zipper option is: track-position?
Much thanks to @borkdude for noticing and reporting!
1 parent 44ab57c commit fd518e2

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

doc/01-user-guide.adoc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,12 @@ Let's explore:
437437
[#position-tracking]
438438
==== Tracking Position with the Zip API
439439

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.
441441
Note that the row and column are 1-based.
442442

443443
[TIP]
444444
====
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.
446446
447447
Read up on positional metadata under link:#nodes[rewrite-clj nodes].
448448
====
@@ -510,7 +510,7 @@ When creating a new zipper you may optionally include an options map.
510510
These options will be carried by the zipper and live for the life of the zipper.
511511
Current options are:
512512

513-
* `:track-position` - see <<position-tracking>>
513+
* `:track-position?` - see <<position-tracking>>
514514
* `:auto-resolve` - see <<custom-auto-resolve>>
515515

516516
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
524524
(require '[rewrite-clj.zip :as z])
525525
526526
;; some contrived options to demonstrate:
527-
(def zip-opts {:track-position true
527+
(def zip-opts {:track-position? true
528528
:auto-resolve (fn [_alias] 'custom-resolved)})
529529
530-
531530
(-> "(+ 10 20 30)" ;; <- something more complicated would be here, of course
532531
(z/of-string zip-opts) ;; <- our opts are passed in on creation
533532
z/down z/right z/right

doc/design/01-merging-rewrite-clj-and-rewrite-cljs.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,6 @@ We:
697697
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.
698698
3. include rewrite-cljs's positional functions: `rewrite-clj.zip/find-last-by-pos` and `rewrite-clj.zip/find-tag-by-pos`.
699699

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})`
701701

702702
=== link:namespaced-elements.adoc[Namespaced maps and keywords]

test/rewrite_clj/zip_test.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185

186186
(deftest t-zipper-options-are-retained-after-operations
187187
;; use a custom auto-resolve to verify that options are still in effect on returned zippers
188-
;; test with both track-position true (rewrite-clj.custom-zipper.core) and false (clojure.zip)
188+
;; test with both track-position? true (rewrite-clj.custom-zipper.core) and false (clojure.zip)
189189
(let [opts {:track-position? true
190190
:auto-resolve (constantly 'testing123)}]
191191
(doseq [opts [(assoc opts :track-position? false)

0 commit comments

Comments
 (0)