-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code Editor 2: "Auto-indent clipboard content" inserts tabs where they don't belong #6708
Comments
Fixed. See #6243 for details |
Reopening as I'm still seeing a similar issue in IDE v2024.1100.0.624 Runtime v2024.1100.0.650, thanks. |
I'm not sure this issue is fully resolvable without a full fat pretty printer. The current heuristic is that the clipboard contents are reformatted to the local indentation level by calculating the indent delta from the first line of the clipboard contents and the insertion line. This works well if the clipboard contents are fully qualified (i.e. the leading whitespace is preserved on all lines). However, if the first line's whitespace is missing and subsequent lines preserve their indentation there is no way to recover the missing indentation for the delta calculation. Any assumption you make will inevitably be wrong in some context. The only solution is to completely dismiss any indentation in the clipboard contents and run them through a pretty printer in context of the insertion line. This is what the old implementation did, however the old implementation relied on our single-line indentation pretty printer which is not a full fat pretty printer and is incapable of calculating indentation appropriately for all styles that users might want (or even correct indentation for BSD-style in some cases). The only solution I can see for now is to simply disable this feature until a full fat pretty printer is developed. For documentation purposes I have attempted the following alternative heuristics to no success in all contexts.
Heuristics (
None of these have successfully handled all 3 contexts. |
Until there's no pretty printer, same results as CE1 (if it's possible) would be enough. We're used for years to how it works, so would be good if there's no change here. |
This feature has temporarily been removed due to the above stated reasons. |
Verified on IDE v9.9.1.900 Runtime v9.9.1.1044. |
Description
I'm not sure if this is the same bug as #5356 or not, which looks like it has to do with curly brace behavior
When you paste code into an area with the same indentation level as the place where it came from, extra tabs get added
This doesn't happen if the Auto Indent setting is turned off
Expected Change
No response
Steps To Reproduce
How reliably can you recreate this issue using your steps above?
Always
Which version of GameMaker are you reporting this issue for?
2024.600 (Betas)
Which operating system(s) are you seeing the problem on?
Windows 10
Are you running GameMaker from inside your Steam library?
No
Contact Us Package Attached?
Sample Project Added?
The text was updated successfully, but these errors were encountered: