Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent "too many nested groupings" xcode crash on undo #951

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion XVim/Test/XVimTester+Issues.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 <lt>C-e> <lt>C-o>$<CR>i<Right><Right><Up><Up><C-e><ESC>", text1 , 10, 0), // Issue #416
Expand Down Expand Up @@ -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, @"r<cr>u", issue_951, 0, 0), // Issue #951

XVimMakeTestCase(text0, 0, 0, @":nmap <lt>backspace> l<cr><bs><bs>", text0, 2, 0), // Issue #844 mapping <backspace>
nil];
Expand Down
2 changes: 1 addition & 1 deletion XVim/XVimReplaceEvaluator.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down