Skip to content

Commit

Permalink
Fix #675 and #1004
Browse files Browse the repository at this point in the history
  • Loading branch information
JugglerShu committed Jan 28, 2017
1 parent 1313c37 commit 71bc6d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion XVim/NSTextStorage+VimOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ - (NSUInteger)xvim_firstOfLine:(NSUInteger)index
return NSNotFound;
}

if (pos == index && isNewline([self.xvim_string characterAtIndex:(pos - 1)])) {
if (pos == index && isNewline([self.xvim_string characterAtIndex:(pos)])) {
return NSNotFound;
}
return pos;
Expand Down
5 changes: 1 addition & 4 deletions XVim/NSTextView+VimOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -1432,10 +1432,7 @@ - (void)xvim_insertNewlineAboveCurrentLine{
}

- (void)xvim_insertNewlineAboveCurrentLineWithIndent{
NSUInteger head = [self.textStorage xvim_firstOfLine:self.insertionPoint];
if( NSNotFound == head ){
head = self.insertionPoint;
}
NSUInteger head = [self.textStorage xvim_startOfLine:self.insertionPoint];
if( 0 != head ){
[self setSelectedRange:NSMakeRange(head-1,0)];
[self insertNewline:self];
Expand Down

0 comments on commit 71bc6d6

Please sign in to comment.