summaryrefslogtreecommitdiff
path: root/fnl/config/comment.fnl
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-05-01 23:06:03 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-05-01 23:06:03 +0200
commitf845a7b0588559750b1cb7eede1b3aecb450cdfe (patch)
tree1c2028e77ef60fb5a00e0abce46a0d4bf66d76d9 /fnl/config/comment.fnl
parent609daf2f632e907f0aed920084b51f608a63edf7 (diff)
style: fmt with fnlfmt
Diffstat (limited to 'fnl/config/comment.fnl')
-rw-r--r--fnl/config/comment.fnl36
1 files changed, 15 insertions, 21 deletions
diff --git a/fnl/config/comment.fnl b/fnl/config/comment.fnl
index 92df966..78eaa7d 100644
--- a/fnl/config/comment.fnl
+++ b/fnl/config/comment.fnl
@@ -1,28 +1,22 @@
;; Language aware commenting.
-(module config.comment
- {autoload {util util}})
+(module config.comment {autoload {util util}})
-(defn- get-type [ctx U]
- (if (= ctx.ctype U.ctype.line)
- :__default
- :__multiline))
+(defn- get-type [ctx U] (if (= ctx.ctype U.ctype.line) :__default :__multiline))
-(defn- get-location [ctx U]
- (let [utils (require :ts_context_commentstring.utils)]
- (if (= ctx.ctype U.ctype.block)
- (utils.get_cursor_location)
- (or (= ctx.cmotion U.cmotion.v) (= ctx.cmotion U.cmotion.V))
- (utils.get_visual_start_location)
- nil)))
+(defn- get-location [ctx U] (let [utils (require :ts_context_commentstring.utils)]
+ (if (= ctx.ctype U.ctype.block)
+ (utils.get_cursor_location)
+ (or (= ctx.cmotion U.cmotion.v)
+ (= ctx.cmotion U.cmotion.V))
+ (utils.get_visual_start_location)
+ nil)))
(defn- pre-hook [ctx]
- (let [U (require :Comment.utils)
- internal (require :ts_context_commentstring.internal)]
- (internal.calculate_commentstring
- {:key (get-type ctx U)
- :location (get-location ctx U)})))
+ (let [U (require :Comment.utils)
+ internal (require :ts_context_commentstring.internal)]
+ (internal.calculate_commentstring {:key (get-type ctx U)
+ :location (get-location ctx U)})))
(let [nvim-comment (util.load-plugin :Comment)]
- (nvim-comment.setup
- {:pre_hook (fn [ctx]
- (pre-hook ctx))}))
+ (nvim-comment.setup {:pre_hook (fn [ctx]
+ (pre-hook ctx))}))