From 6a60508ff2106efa40c2910850a2065d1b801ef2 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Tue, 24 Mar 2026 13:02:38 +0000 Subject: [PATCH] Fix c/cpp mapping to wrap lines in #if 0/#endif Use `x` mapping so that the mapping does not also get enabled in select mode. --- after/ftplugin/c.lua | 2 +- after/ftplugin/cpp.lua | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/after/ftplugin/c.lua b/after/ftplugin/c.lua index 3e56575..a1f3af6 100644 --- a/after/ftplugin/c.lua +++ b/after/ftplugin/c.lua @@ -1,2 +1,2 @@ local opts = { buffer = true, remap = false, silent = true } -vim.keymap.set('v', '0', ':PreProcIfWrap', opts) +vim.keymap.set('x', '0', ':PreProcIfWrap', opts) diff --git a/after/ftplugin/cpp.lua b/after/ftplugin/cpp.lua index b918641..2518fbf 100644 --- a/after/ftplugin/cpp.lua +++ b/after/ftplugin/cpp.lua @@ -2,5 +2,4 @@ vim.opt.commentstring = '//%s' vim.opt.matchpairs:append('<:>') local opts = { buffer = true, remap = false, silent = true } --- vim.keymap.set('n', '0', ':PreProcIfWrap', opts) -vim.keymap.set('v', '0', ':PreProcIfWrap', opts) +vim.keymap.set('x', '0', ':PreProcIfWrap', opts)