Skip to content

Commit

Permalink
Merge pull request #58 from kimitake/fix-cursor-class
Browse files Browse the repository at this point in the history
BugFix: Cursor isLastLine and right calculating end of line incorrectly.
  • Loading branch information
jpoon committed Nov 30, 2015
2 parents 455f957 + 04a1206 commit 88343c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class Cursor {
let pos = this.currentPosition();
let column = pos.character;

if (column < TextEditor.ReadLine(pos.line).length) {
if (column < TextEditor.ReadLine(pos.line).length - 1) {
column++;
}

Expand Down Expand Up @@ -90,7 +90,7 @@ export default class Cursor {
}

private static isLastLine(line: number): boolean {
return (vscode.window.activeTextEditor.document.lineCount + 1) === line;
return (vscode.window.activeTextEditor.document.lineCount - 1) === line;
}
}

0 comments on commit 88343c7

Please sign in to comment.