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;