From c4d0b44346633ac550bdade512c7fd178396c92a Mon Sep 17 00:00:00 2001 From: "Yixiang (Sean) Lu" Date: Wed, 5 Oct 2016 15:14:18 -0700 Subject: [PATCH] Fixed a index out of bound error when trying to delete the first line of a document. --- XVim/NSTextStorage+VimOperation.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XVim/NSTextStorage+VimOperation.m b/XVim/NSTextStorage+VimOperation.m index 2214e9c3..87fda110 100644 --- a/XVim/NSTextStorage+VimOperation.m +++ b/XVim/NSTextStorage+VimOperation.m @@ -253,7 +253,7 @@ - (NSUInteger)xvim_firstOfLine:(NSUInteger)index return NSNotFound; } - if (pos == index && isNewline([self.xvim_string characterAtIndex:(pos - 1)])) { + if (pos == index && pos > 0 && isNewline([self.xvim_string characterAtIndex:(pos - 1)])) { return NSNotFound; } return pos;