patch 8.2.4907: some users do not want a line comment always inserted
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".
diff --git a/src/change.c b/src/change.c
index 259f076..bebfaab 100644
--- a/src/change.c
+++ b/src/change.c
@@ -1659,7 +1659,8 @@
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);