mirror of
https://github.com/neovim/neovim.git
synced 2025-09-26 21:18:34 +00:00
vim-patch:8.2.5008: when 'formatoptions' contains "/" wrongly wrapping comment (#18717)
Problem: When 'formatoptions' contains "/" wrongly wrapping a long trailing
comment.
Solution: Pass the OPENLINE_FORMAT flag.
7e66778815
This commit is contained in:
@@ -1188,7 +1188,7 @@ int open_line(int dir, int flags, int second_line_indent, bool *did_do_comment)
|
||||
if (flags & OPENLINE_DO_COM) {
|
||||
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);
|
||||
if (comment_start != MAXCOL) {
|
||||
|
Reference in New Issue
Block a user