diff --git a/XVim/Test/XVimTester+Issues.m b/XVim/Test/XVimTester+Issues.m index ccc1b260..de76fdae 100644 --- a/XVim/Test/XVimTester+Issues.m +++ b/XVim/Test/XVimTester+Issues.m @@ -61,7 +61,8 @@ - (NSArray*)issues_testcases{ static NSString* issue_865 = @"\n" // 0 @"\n" // 1 @"ccc\n";// 2 - + static NSString* issue_951 = @"aaaa\n"; + return [NSArray arrayWithObjects: XVimMakeTestCase(text0, 0, 0, @"qadwpq", @"baaa bb ccc\n", 4, 0), // Issue #396 XVimMakeTestCase(text1, 24, 0, @":inoremap C-e> C-o>$i", text1 , 10, 0), // Issue #416 @@ -89,6 +90,7 @@ - (NSArray*)issues_testcases{ XVimMakeTestCase(issue_865 , 2, 0, @"2gg", issue_865, 1, 0), // Issue #865 XVimMakeTestCase(issue_865 , 2, 0, @"2G", issue_865, 1, 0), // Issue #865 XVimMakeTestCase(issue_865 , 2, 0, @"G", issue_865, 6, 0), // Issue #865 + XVimMakeTestCase(issue_951 , 0, 0, @"ru", issue_951, 0, 0), // Issue #951 XVimMakeTestCase(text0, 0, 0, @":nmap backspace> l", text0, 2, 0), // Issue #844 mapping nil]; diff --git a/XVim/XVimReplaceEvaluator.m b/XVim/XVimReplaceEvaluator.m index a5564a12..6a93d922 100644 --- a/XVim/XVimReplaceEvaluator.m +++ b/XVim/XVimReplaceEvaluator.m @@ -91,7 +91,7 @@ - (XVimEvaluator*)eval:(XVimKeyStroke*)keyStroke{ // The input coming to this method is already handled by "Input Method" // and the input maight be non ascii like 'あ' if (self.oneCharMode || keyStroke.isPrintable) { - if (!keyStroke.isPrintable) { + if (!keyStroke.isPrintable && keyStroke.character != '\r') { nextEvaluator = [XVimEvaluator invalidEvaluator]; } else if (![self.sourceView xvim_replaceCharacters:keyStroke.character count:1]) { nextEvaluator = [XVimEvaluator invalidEvaluator];