diff options
author | Christian Clason <c.clason@uni-graz.at> | 2022-05-07 16:49:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-07 16:49:36 +0200 |
commit | 0a00792332add35c23b7cf96618ea317e7383a11 (patch) | |
tree | 1e82f58d130262d4c204b189c1f00ecaf92451fc /src/nvim/change.c | |
parent | 03471e292d48283379a397dadf902572de91b359 (diff) | |
download | rneovim-0a00792332add35c23b7cf96618ea317e7383a11.tar.gz rneovim-0a00792332add35c23b7cf96618ea317e7383a11.tar.bz2 rneovim-0a00792332add35c23b7cf96618ea317e7383a11.zip |
vim-patch:8.2.4907: some users do not want a line comment always inserted (#18463)
Problem: Some users do not want a line comment always inserted.
Solution: Add the '/' flag to 'formatoptions' to not repeat the comment
leader after a statement when using "o".
https://github.com/vim/vim/commit/2bf875f881f7c6f6900bc0eb2a93a552db894109
Diffstat (limited to 'src/nvim/change.c')
-rw-r--r-- | src/nvim/change.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c index bbb10d3a52..426310488a 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -1186,7 +1186,8 @@ int open_line(int dir, int flags, int second_line_indent, bool *did_do_comment) end_comment_pending = NUL; 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) { + if (lead_len == 0 && curbuf->b_p_cin && do_cindent && dir == FORWARD + && !has_format_option(FO_NO_OPEN_COMS)) { // Check for a line comment after code. comment_start = check_linecomment(saved_line); if (comment_start != MAXCOL) { |