Make tslint happy

This commit is contained in:
rebornix 2016-06-27 16:01:24 +08:00
parent 33e28c4c33
commit 5f4d58da26
2 changed files with 6 additions and 5 deletions

View File

@ -501,8 +501,10 @@ export class Position extends vscode.Position {
for (let currentLine = this.line; currentLine >= paragraphBegin.line; currentLine--) {
let endPositions = this.getAllEndPositions(TextEditor.getLineAt(new vscode.Position(currentLine, 0)).text, regex);
let newCharacter = _.find(endPositions.reverse(),
index => ((index < this.character && !inclusive && new Position(currentLine, index).getRightThroughLineBreaks().compareTo(this)) ||
(index <= this.character && inclusive)) || currentLine !== this.line)
index => ((index < this.character && !inclusive
&& new Position(currentLine, index).getRightThroughLineBreaks().compareTo(this))
|| (index <= this.character && inclusive)
) || currentLine !== this.line);
if (newCharacter !== undefined) {
return new Position(currentLine, newCharacter).getRightThroughLineBreaks();
@ -511,8 +513,7 @@ export class Position extends vscode.Position {
if ((paragraphBegin.line + 1 === this.line || paragraphBegin.line === this.line)) {
return paragraphBegin;
}
else {
} else {
return new Position(paragraphBegin.line + 1, 0);
}
}

View File

@ -420,7 +420,7 @@ suite("sentence motion", () => {
let motion = new Position(0, 35).getPreviousSentenceBegin();
assert.equal(motion.line, 0);
assert.equal(motion.character, 0);
})
});
test("current sentence begin with no concrete sentense inside", () => {
let motion = new Position(3, 0).getPreviousSentenceBegin();