summaryrefslogtreecommitdiff
path: root/src/clarktown/engine.clj
diff options
context:
space:
mode:
authorAsko Nõmm <asko@bien.ee>2022-04-25 13:28:36 +0300
committerAsko Nõmm <asko@bien.ee>2022-04-25 13:28:36 +0300
commitd6e39c016e16b60b85b60898e93eda8d2c6f00db (patch)
tree8bfa72a89d4b4a97a272d51c40b89eb159ce1c6a /src/clarktown/engine.clj
parent829a5b1d96f2fd04f992dd3792d0faac5aacc2a8 (diff)
Improve naming
Diffstat (limited to 'src/clarktown/engine.clj')
-rw-r--r--src/clarktown/engine.clj20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/clarktown/engine.clj b/src/clarktown/engine.clj
index 2dc9089..deca176 100644
--- a/src/clarktown/engine.clj
+++ b/src/clarktown/engine.clj
@@ -39,29 +39,29 @@
"Corrects block separations and adds newlines above or
below a block where needed."
[correctors lines]
- (let [above-correctors (:empty-line-above? correctors)
- below-correctors (:empty-line-below? correctors)]
+ (let [above-correctors (:newline-above correctors)
+ below-correctors (:newline-below correctors)]
(map-indexed
(fn [index line]
- (let [add-line-above? (some #(true? (% lines line index)) above-correctors)
- add-line-below? (some #(true? (% lines line index)) below-correctors)]
+ (let [add-newline-above? (some #(true? (% lines line index)) above-correctors)
+ add-newline-below? (some #(true? (% lines line index)) below-correctors)]
(cond
; If code block starts but there is no empty newline
; above, let's fix that
- (and add-line-above?
- (not add-line-below?))
+ (and add-newline-above?
+ (not add-newline-below?))
(str \newline line)
; If the code block ends, but there is no empty newline
; below, let's fix that.
- (and add-line-below?
- (not add-line-above?))
+ (and add-newline-below?
+ (not add-newline-above?))
(str line \newline)
; If the code block needs a newline both above and below,
; let's fix that.
- (and add-line-above?
- add-line-below?)
+ (and add-newline-above?
+ add-newline-below?)
(str \newline line \newline)
; otherwise is what it is