vim-mode: fix % behovior in d/c command

This commit is contained in:
Le Tan 2018-01-04 21:15:13 +08:00
parent 044b3d3c29
commit 2bdad19253

View File

@ -3346,13 +3346,21 @@ handle_target:
second = tmp; second = tmp;
} }
--second; if (!(checkMode(VimMode::Normal) && p_moveMode == QTextCursor::KeepAnchor)) {
--second;
}
int target = first; int target = first;
if (first == pairPosition) { if (first == pairPosition) {
target = second; target = second;
} }
if (anchor > target
&& !p_cursor.atEnd()
&& !useLeftSideOfCursor(p_cursor)) {
++anchor;
}
p_cursor.setPosition(anchor); p_cursor.setPosition(anchor);
p_cursor.setPosition(target, p_moveMode); p_cursor.setPosition(target, p_moveMode);