1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-08-10 06:40:37 +02:00

Fixed right selection range of 'vi"' motion

This commit is contained in:
Andrey Vlasovskikh 2012-11-27 20:09:23 +04:00
parent 1195b3e507
commit 51837c9e9e
3 changed files with 13 additions and 2 deletions
src/com/maddyhome/idea/vim
test/org/jetbrains/plugins/ideavim/action

View File

@ -315,7 +315,11 @@ public class SearchHelper {
if (end == -1) {
return null;
}
return new TextRange(isOuter ? start : start + 1, end);
if (!isOuter) {
start++;
end--;
}
return new TextRange(start, end);
}
private static boolean checkInString(CharSequence chars, int pos, boolean str) {

View File

@ -875,7 +875,7 @@ public class RegisterActions {
new Shortcut("i)")
});
parser.registerAction(KeyParser.MAPPING_VISUAL | KeyParser.MAPPING_OP_PEND, "VimMotionInnerBlockQuote", Command.Type.MOTION,
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_TEXT_BLOCK, new Shortcut[]{
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK, new Shortcut[]{
new Shortcut("i\""),
});
parser.registerAction(KeyParser.MAPPING_VISUAL | KeyParser.MAPPING_OP_PEND, "VimMotionOuterBlockAngle",

View File

@ -287,6 +287,13 @@ public class MotionActionTest extends VimTestCase {
myFixture.checkResult("foo = [\"\", \"two\", \"three\"];\n");
}
// VIM-132 |v_i"|
public void testInnerDoubleQuotedStringSelection() {
typeTextInFile(stringToKeys("vi\""),
"foo = [\"o<caret>ne\", \"two\"];\n");
assertSelection("one");
}
// |%|
public void testPercentMatchSimple() {
typeTextInFile(stringToKeys("%"),