mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
Allow empty selections -> index.
This commit is contained in:
@@ -361,9 +361,6 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD
|
||||
this._focused = focused;
|
||||
}
|
||||
|
||||
/**
|
||||
* Empty selection will be turned to `null`
|
||||
*/
|
||||
validateRange(cellRange: ICellRange | null | undefined): ICellRange | null {
|
||||
if (!cellRange) {
|
||||
return null;
|
||||
@@ -372,11 +369,7 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD
|
||||
const start = clamp(cellRange.start, 0, this.length);
|
||||
const end = clamp(cellRange.end, 0, this.length);
|
||||
|
||||
if (start === end) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (start < end) {
|
||||
if (start <= end) {
|
||||
return { start, end };
|
||||
} else {
|
||||
return { start: end, end: start };
|
||||
|
||||
Reference in New Issue
Block a user