patch 8.2.5008: when 'formatoptions' contains "/" wrongly wrapping comment
Problem: When 'formatoptions' contains "/" wrongly wrapping a long trailing
comment.
Solution: Pass the OPENLINE_FORMAT flag.
diff --git a/src/change.c b/src/change.c
index 25a96f8..b653dcc 100644
--- a/src/change.c
+++ b/src/change.c
@@ -1643,7 +1643,8 @@
lead_len = get_leader_len(saved_line, &lead_flags,
dir == BACKWARD, TRUE);
if (lead_len == 0 && curbuf->b_p_cin && do_cindent && dir == FORWARD
- && !has_format_option(FO_NO_OPEN_COMS))
+ && (!has_format_option(FO_NO_OPEN_COMS)
+ || (flags & OPENLINE_FORMAT)))
{
// Check for a line comment after code.
comment_start = check_linecomment(saved_line);