diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-05-23 21:27:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-23 21:27:57 +0800 |
commit | 4b4643be07e4e9259b3cb05e511e5047778733c1 (patch) | |
tree | b840362430fd1d5a82768bbddc459c67992b26e3 /src/nvim/change.c | |
parent | 4c6626f03dc645a426c1e63ca372b96f1073581b (diff) | |
download | rneovim-4b4643be07e4e9259b3cb05e511e5047778733c1.tar.gz rneovim-4b4643be07e4e9259b3cb05e511e5047778733c1.tar.bz2 rneovim-4b4643be07e4e9259b3cb05e511e5047778733c1.zip |
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.
https://github.com/vim/vim/commit/7e667788150be617aeac42b0d668618ac33ab9da
Diffstat (limited to 'src/nvim/change.c')
-rw-r--r-- | src/nvim/change.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c index 349f74e280..c1fe5bc405 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -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) { |