You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here another variant with 1.33.0
Structure looks fine, but after copy&paste format is mismatch. After paste I press shortcut STRG+Z (german) for "undo" and its not remove the block, its formatted the block correctly!? A second "undo" remove the pasted block. Create formating new with starting from line beginning the copy&paste error is gone. See
The difference of indentation in a pasted block vs. receiving code gets applied to a line of code directly after paste location. Meaning: if you copy 8-spaces indented code and paste it into 4-spaces indented code, one of the original code lines incorrectly gets deindented by four spaces. If the copied code was indented less than the paste location, extra indent gets added to the next line. My testcases https://paste.zi.fi/p/vscodebug.py/view
This is due to the limited architecture (regex based indentation rules and only support limited code styles), we may want to consider using formatters if they exist for indenation adjustment (if interested, we can discuss in #19847).
For this particular issue, if the indentation rules are leading to more trouble than having no auto indent, you can set editor.autoIndent to advanced to disable the regex based indentation adjustment or use auto formatting (editor.formatOnType, editor.formatOnPaste). As we don't have an easy good-enough fix for it, we close it for now and explore better solutions through issues like (#19847 and #34621).
Activity
Daijobou commentedon Jan 3, 2019
Here is much more issues with autoindent. Should I create a new ticket or paste it here? Example

Daijobou commentedon Apr 10, 2019
Here another variant with 1.33.0

Structure looks fine, but after copy&paste format is mismatch. After paste I press shortcut STRG+Z (german) for "undo" and its not remove the block, its formatted the block correctly!? A second "undo" remove the pasted block. Create formating new with starting from line beginning the copy&paste error is gone. See
Tronic commentedon Aug 13, 2019
The difference of indentation in a pasted block vs. receiving code gets applied to a line of code directly after paste location. Meaning: if you copy 8-spaces indented code and paste it into 4-spaces indented code, one of the original code lines incorrectly gets deindented by four spaces. If the copied code was indented less than the paste location, extra indent gets added to the next line. My testcases https://paste.zi.fi/p/vscodebug.py/view
rebornix commentedon Nov 3, 2020
This is due to the limited architecture (regex based indentation rules and only support limited code styles), we may want to consider using formatters if they exist for indenation adjustment (if interested, we can discuss in #19847).
For this particular issue, if the indentation rules are leading to more trouble than having no auto indent, you can set
editor.autoIndenttoadvancedto disable the regex based indentation adjustment or use auto formatting (editor.formatOnType,editor.formatOnPaste). As we don't have an easy good-enough fix for it, we close it for now and explore better solutions through issues like (#19847 and #34621).Fix indentation issues when pasting with trailing newline
Fix indentation issues when pasting with trailing newline
Fix indentation issues when pasting with trailing newline
Fix indentation issues when pasting with trailing newline
Fix indentation issues when pasting with trailing newline
Fix indentation issues when pasting with trailing newline
Fix indentation issues when pasting with trailing newline
Fix indentation issues when pasting with trailing newline
Fix indentation issues when pasting with trailing newline
Fix indentation issues when pasting with trailing newline