comparison src/change.c @ 26811:f0fdd992cfb9 v8.2.3934

patch 8.2.3934: repeating line comment is undesired for "O" command Commit: https://github.com/vim/vim/commit/5ea5f373729589acb38ce3f3ca338e8a6d398bdc Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 29 15:15:47 2021 +0000 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 https://github.com/vim/vim/issues/9426)
author Bram Moolenaar <Bram@vim.org>
date Wed, 29 Dec 2021 16:30:03 +0100
parents 255bc9a08e58
children d02d40f0261c
comparison
equal deleted inserted replaced
26810:9c34e5550c98 26811:f0fdd992cfb9
1653 if (flags & OPENLINE_DO_COM) 1653 if (flags & OPENLINE_DO_COM)
1654 { 1654 {
1655 lead_len = get_leader_len(saved_line, &lead_flags, 1655 lead_len = get_leader_len(saved_line, &lead_flags,
1656 dir == BACKWARD, TRUE); 1656 dir == BACKWARD, TRUE);
1657 #ifdef FEAT_CINDENT 1657 #ifdef FEAT_CINDENT
1658 if (lead_len == 0 && do_cindent) 1658 if (lead_len == 0 && do_cindent && dir == FORWARD)
1659 { 1659 {
1660 // Check for a line comment after code.
1660 comment_start = check_linecomment(saved_line); 1661 comment_start = check_linecomment(saved_line);
1661 if (comment_start != MAXCOL) 1662 if (comment_start != MAXCOL)
1662 { 1663 {
1663 lead_len = get_leader_len(saved_line + comment_start, 1664 lead_len = get_leader_len(saved_line + comment_start,
1664 &lead_flags, dir == BACKWARD, TRUE); 1665 &lead_flags, FALSE, TRUE);
1665 if (lead_len != 0) 1666 if (lead_len != 0)
1666 { 1667 {
1667 lead_len += comment_start; 1668 lead_len += comment_start;
1668 if (did_do_comment != NULL) 1669 if (did_do_comment != NULL)
1669 *did_do_comment = TRUE; 1670 *did_do_comment = TRUE;