summaryrefslogtreecommitdiffstats
path: root/src/change.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-05-07 14:54:11 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-07 14:54:11 +0100
commit2bf875f881f7c6f6900bc0eb2a93a552db894109 (patch)
tree43f3b1e70f88d05eeae1020899af539b23775846 /src/change.c
parentaa04e1b0be343ff606e25a48d59bc057edcc6e87 (diff)
patch 8.2.4907: some users do not want a line comment always insertedv8.2.4907
Problem: Some users do not want a line comment always inserted. Solution: Add the '/' flag to 'formatoptions' to not repeat the comment leader after a statement when using "o".
Diffstat (limited to 'src/change.c')
-rw-r--r--src/change.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/change.c b/src/change.c
index 259f07664a..bebfaabff8 100644
--- a/src/change.c
+++ b/src/change.c
@@ -1659,7 +1659,8 @@ open_line(
lead_len = get_leader_len(saved_line, &lead_flags,
dir == BACKWARD, TRUE);
#ifdef FEAT_CINDENT
- if (lead_len == 0 && curbuf->b_p_cin && do_cindent && dir == FORWARD)
+ if (lead_len == 0 && curbuf->b_p_cin && do_cindent && dir == FORWARD
+ && !has_format_option(FO_NO_OPEN_COMS))
{
// Check for a line comment after code.
comment_start = check_linecomment(saved_line);