We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d55b443 commit cf9dceeCopy full SHA for cf9dcee
1 file changed
src/vs/editor/contrib/linesOperations/browser/linesOperations.ts
@@ -215,7 +215,10 @@ abstract class AbstractMoveLinesAction extends EditorAction {
215
for (const selection of selections) {
216
if (movingMultipleLines) {
217
// If we are at the beginning/end of document and multiple lines are moved, abort.
218
- if ((selection.startLineNumber === 1 && !this.down) || (selection.endLineNumber === editor.getModel()?.getLineCount() && this.down)) {
+ let model = editor.getModel();
219
+ let lineCount = model !== null ? model.getLineCount() : 0;
220
+
221
+ if ((selection.startLineNumber === 1 && !this.down) || (selection.endLineNumber === lineCount && this.down)) {
222
editor.pushUndoStop();
223
return;
224
}
0 commit comments