mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-09-22 01:28:22 +03:00
isValid() no longer throws errors
This commit is contained in:
parent
0741038634
commit
ae454a1bb7
@ -633,15 +633,19 @@ export class Position extends vscode.Position {
|
||||
}
|
||||
|
||||
public isValid(): boolean {
|
||||
// line
|
||||
let lineCount = TextEditor.getLineCount() || 1;
|
||||
if (this.line >= lineCount) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
// line
|
||||
let lineCount = TextEditor.getLineCount() || 1;
|
||||
if (this.line >= lineCount) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// char
|
||||
let charCount = Position.getLineLength(this.line);
|
||||
if (this.character > charCount + 1) {
|
||||
// char
|
||||
let charCount = Position.getLineLength(this.line);
|
||||
if (this.character > charCount + 1) {
|
||||
return false;
|
||||
}
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user