From 054a287dbe6fe4308d26ec593da2057641f2bb9b Mon Sep 17 00:00:00 2001 From: Soham Shanbhag Date: Mon, 3 Jun 2024 16:48:43 +0900 Subject: feat(ftplugin): change 'commentstring' to `// %s` for C/C++ (#29085) Problem: The default commentstring for C/C++ can lead to invalid code when commenting and does not match the Nvim codebase. Solution: Change commentstring to `// %s` as used by Neovim. Also set all commentstrings that derive from the default C string explicitly (and correctly). --- runtime/ftplugin/d.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/ftplugin/d.lua') diff --git a/runtime/ftplugin/d.lua b/runtime/ftplugin/d.lua index b4e68148f5..f398d66a63 100644 --- a/runtime/ftplugin/d.lua +++ b/runtime/ftplugin/d.lua @@ -1 +1 @@ -vim.bo.commentstring = '/*%s*/' +vim.bo.commentstring = '// %s' -- cgit From 8f5e90811025bcc652146168d5116f8d73fe8f81 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 1 Jul 2024 17:48:09 +0800 Subject: fix(runtime): update b:undo_ftplugin in Lua runtime files (#29529) Related to #29506, but adding vim.treesitter.stop() to b:undo_ftplugin doesn't solve the problem yet. --- runtime/ftplugin/d.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/ftplugin/d.lua') diff --git a/runtime/ftplugin/d.lua b/runtime/ftplugin/d.lua index f398d66a63..49a8702986 100644 --- a/runtime/ftplugin/d.lua +++ b/runtime/ftplugin/d.lua @@ -1 +1,3 @@ vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = 'setl commentstring<' -- cgit From 50577534318bbf8c1e22e80a74baa3b20c131ea8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 23 Sep 2024 16:49:34 +0800 Subject: fix(runtime): treat b:undo_ftplugin consistently in Lua ftplugins (#30473) - Don't assume b:undo_ftplugin is set when first modifying it. - Don't assume b:undo_ftplugin already contains some resetting. --- runtime/ftplugin/d.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/ftplugin/d.lua') diff --git a/runtime/ftplugin/d.lua b/runtime/ftplugin/d.lua index 49a8702986..89ab42ef54 100644 --- a/runtime/ftplugin/d.lua +++ b/runtime/ftplugin/d.lua @@ -1,3 +1,3 @@ vim.bo.commentstring = '// %s' -vim.b.undo_ftplugin = 'setl commentstring<' +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' -- cgit