Mercurial > vim
diff src/change.c @ 28972:864fa5276e78 v8.2.5008
patch 8.2.5008: when 'formatoptions' contains "/" wrongly wrapping comment
Commit: https://github.com/vim/vim/commit/7e667788150be617aeac42b0d668618ac33ab9da
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 23 13:10:48 2022 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 23 May 2022 14:15:03 +0200 |
parents | 6cdf55afaae9 |
children | 45c182c4f7e9 |
line wrap: on
line diff
--- a/src/change.c +++ b/src/change.c @@ -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);