mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 10:12:34 -05:00
Merge from vscode 2b0b9136329c181a9e381463a1f7dc3a2d105a34 (#4880)
This commit is contained in:
@@ -894,11 +894,19 @@ export class TextModel extends Disposable implements model.ITextModel {
|
||||
* @param strict Do NOT allow a position inside a high-low surrogate pair
|
||||
*/
|
||||
private _isValidPosition(lineNumber: number, column: number, strict: boolean): boolean {
|
||||
if (isNaN(lineNumber)) {
|
||||
if (typeof lineNumber !== 'number' || typeof column !== 'number') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (lineNumber < 1) {
|
||||
if (isNaN(lineNumber) || isNaN(column)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (lineNumber < 1 || column < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((lineNumber | 0) !== lineNumber || (column | 0) !== column) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -907,14 +915,6 @@ export class TextModel extends Disposable implements model.ITextModel {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isNaN(column)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (column < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const maxColumn = this.getLineMaxColumn(lineNumber);
|
||||
if (column > maxColumn) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user