From d6e39c016e16b60b85b60898e93eda8d2c6f00db Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Mon, 25 Apr 2022 13:28:36 +0300 Subject: Improve naming --- src/clarktown/engine.clj | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/clarktown/engine.clj') 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 -- cgit v1.2.3