summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2021-10-19 18:19:46 +0200
committerAndreas Schneider <asn@cryptomilk.org>2021-10-19 18:19:46 +0200
commit301b1cbab3851b1e8e479b3b8d73e1448f52be4d (patch)
treebe4d8ffa87702f099823a826d0df11ca121aad16
parentfc8dc3cbe6304d6b262d8fbb76100cbb8bb518a1 (diff)
downloaddotfiles-301b1cbab3851b1e8e479b3b8d73e1448f52be4d.tar.gz
dotfiles-301b1cbab3851b1e8e479b3b8d73e1448f52be4d.tar.xz
dotfiles-301b1cbab3851b1e8e479b3b8d73e1448f52be4d.zip
nvim:comment: Don't run pre_hook for line comment
-rw-r--r--nvim/.config/nvim/lua/plugins/comment.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/nvim/.config/nvim/lua/plugins/comment.lua b/nvim/.config/nvim/lua/plugins/comment.lua
index a75fafd..aea4b6f 100644
--- a/nvim/.config/nvim/lua/plugins/comment.lua
+++ b/nvim/.config/nvim/lua/plugins/comment.lua
@@ -13,6 +13,10 @@ local post_hook = function(ctx, srow, erow)
return
end
+ if ctx.ctype == 1 then
+ return
+ end
+
local cfg = require('Comment').get_config()
local cstr = ft.get(vim.bo.filetype, ctx.ctype)
local lcs, rcs = U.unwrap_cstr(cstr)