Change:
} } else { // it doesn't match onEnter rules, let's check indentation rules then. <del> virtualModel.getLineContent = (lineNumber: number) => { if (lineNumber === s.startLineNumber) { return insertingText; } else if (lineNumber >= s.startLineNumber + 1 && lineNumber <= s.endLineNumber + 1) { return model.getLineContent(lineNumber - 1); } else { return model.getLineContent(lineNumber); } </del> <ins> const virtualModel: IVirtualModel = { tokenization: { getLineTokens: (lineNumber: number) => { if (lineNumber === s.startLineNumber) { return model.tokenization.getLineTokens(movingLineNumber); } else if (lineNumber >= s.startLineNumber + 1 && lineNumber <= s.endLineNumber + 1) { return model.tokenization.getLineTokens(lineNumber - 1); } else { return model.tokenization.getLineTokens(lineNumber); } }, getLanguageId, getLanguageIdAtPosition, }, getLineContent: (lineNumber: number) => { if (lineNumber === s.startLineNumber) { return insertingText; } else if (lineNumber >= s.startLineNumber + 1 && lineNumber <= s.endLineNumber + 1) { return model.getLineContent(lineNumber - 1); } else { return model.getLineContent(lineNumber); } }, </ins> }; const newIndentatOfMovingBlock = getGoodIndentForLine(

Discussion:
Have the following code Move line request down via Notice how the lines that have been passed change. Their indentation gets modified. The move line down command should not mutate lines it passes.
See and for similar/duplicates.
should be fixed by
Thanks for the fix!

Start with the following code: select the first method move it down
This reproduces for very simple examples:
See also and
Should be fixed with

<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.90.0 OS Version: Windows 10 Home 22H2 build .4412 (+ WSL2 inside Win10) Steps to Reproduce: (similar to this issue: ) code: cursor at line 5 and perform 3 times. moved line is misplaced: In a vscode window opened in WSL this also happens: 1-WSL. Sample code: 2-WSL. Set cursor at line 2 and perform 3 times. 3-WSL. The last bracked is misplaced:
should be fixed by

<!-- Do Not Delete This! featurerequesttemplate --<!-- Please read our Rules of Conduct: --<!-- Please search existing issues to avoid creating duplicates. --<!-- Describe the feature you'd like. --When writing Lua code in VSCode, using Alt + Up/Down to move a line of code no longer automatically aligns the context of the code. Before the update, it would automatically align.
could you please help triage this issue? Thank you!
Hi yes thanks for the ping, this appears to be related to some recent auto-indentation changes I have made.
should be fixed with