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 677e81e commit ee5b5bdCopy full SHA for ee5b5bd
src/rewrite_clj/zip/whitespace.clj
@@ -44,13 +44,19 @@
44
"Prepend a whitespace node representing the given number of spaces (default: 1)."
45
([zloc] (prepend-space zloc 1))
46
([zloc n]
47
- (z/insert-left zloc (node/spaces n))))
+ {:pre [(>= n 0)]}
48
+ (if (pos? n)
49
+ (z/insert-left zloc (node/spaces n))
50
+ zloc)))
51
52
(defn append-space
53
"Append a whitespace node representing the given number of spaces (default: 1)."
54
([zloc] (append-space zloc 1))
55
- (z/insert-right zloc (node/spaces n))))
56
57
58
+ (z/insert-right zloc (node/spaces n))
59
60
61
(defn prepend-newline
62
0 commit comments