forked from aniani/vim
patch 8.2.3934: repeating line comment is undesired for "O" command
Problem: Repeating line comment is undesired for "O" command. Solution: Do not copy line comment leader for "O". (closes #9426)
This commit is contained in:
@@ -1655,13 +1655,14 @@ open_line(
|
||||
lead_len = get_leader_len(saved_line, &lead_flags,
|
||||
dir == BACKWARD, TRUE);
|
||||
#ifdef FEAT_CINDENT
|
||||
if (lead_len == 0 && do_cindent)
|
||||
if (lead_len == 0 && do_cindent && dir == FORWARD)
|
||||
{
|
||||
// Check for a line comment after code.
|
||||
comment_start = check_linecomment(saved_line);
|
||||
if (comment_start != MAXCOL)
|
||||
{
|
||||
lead_len = get_leader_len(saved_line + comment_start,
|
||||
&lead_flags, dir == BACKWARD, TRUE);
|
||||
&lead_flags, FALSE, TRUE);
|
||||
if (lead_len != 0)
|
||||
{
|
||||
lead_len += comment_start;
|
||||
|
Reference in New Issue
Block a user