1
0
forked from aniani/vim

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.
This commit is contained in:
Bram Moolenaar
2022-05-23 13:10:48 +01:00
parent 6d24b4ff69
commit 7e66778815
5 changed files with 29 additions and 7 deletions

View File

@@ -1643,7 +1643,8 @@ open_line(
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);