mirror of
https://github.com/neovim/neovim.git
synced 2025-09-26 13:08:33 +00:00
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".
2bf875f881
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user