diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-04-11 18:52:34 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-04-11 18:52:34 +0200 |
commit | b74c9dd22e632bbe720587db92966c4d6811b766 (patch) | |
tree | f68e5bb862fd5a800f86852e535d29984f461cb3 /fnl/config/ncomment.fnl | |
parent | 274648011686b1c822e63b03bdcc6f2ce8e9b41e (diff) |
style: format with fnlfmt
Diffstat (limited to 'fnl/config/ncomment.fnl')
-rw-r--r-- | fnl/config/ncomment.fnl | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/fnl/config/ncomment.fnl b/fnl/config/ncomment.fnl index 2c983df..217ba6d 100644 --- a/fnl/config/ncomment.fnl +++ b/fnl/config/ncomment.fnl @@ -1,25 +1,23 @@ ;; Language aware commenting. -(module config.ncomment - {autoload {util util}}) +(module config.ncomment {autoload {util util}}) +(defn- get-type [ctx U] (or (and (= ctx.ctype U.ctype.line) :__default) + :__multiline)) -(defn- get-type [ctx U] - (or (and (= ctx.ctype U.ctype.line) :__default) :__multiline)) - -(defn- get-location [ctx U] - (if (= ctx.ctype U.ctype.block) - ((require :ts_context_commentstring.utils).get_cursor_location) - (or (= ctx.motion U.motion.v) (= ctx.motion U.cmotion.V)) - ((require :ts_context_commentstring.utils).get_visual_start_location) - nil)) +(defn- get-location [ctx U] (if (= ctx.ctype U.ctype.block) + ((require :ts_context_commentstring.utils) .get_cursor_location) + (or (= ctx.motion U.motion.v) + (= ctx.motion U.cmotion.V)) + ((require :ts_context_commentstring.utils) .get_visual_start_location) + nil)) (defn- pre-hook [ctx] - (let [U (require :Comment.utils)] - ((require :ts_context_commentstring.internal).calculate_commentstring { - :key (get-type ctx U) - :location (get-location ctx U)}))) + (let [U (require :Comment.utils)] + ((require :ts_context_commentstring.internal) .calculate_commentstring + {:key (get-type ctx U) + :location (get-location ctx + U)}))) (let [ncomment (util.load-plugin :Comment)] - (ncomment.setup - {:pre_hook (fn [ctx] - (pre-hook ctx))})) + (ncomment.setup {:pre_hook (fn [ctx] + (pre-hook ctx))})) |