-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Improve indentation of lines #28658
Comments
Is this universal across languages? Does that mean that VSCode will finally be able to re-indent? Related: #19847 Thanks for your work on this. |
@borekb first of all, languages need to define indentation rules, otherwise we don't know how to adjust the indentation. secondly embedded language may not work properly as the language service for embedded languages are not avail if you don't open the file marked as that particular language. |
Please consider adding a keybinding to "auto-indent current line" behavior, similar to what other editors do, like in Atom, with the use of , or like in Sublime: As far as I can tell, currently there is no way to auto-indent the current line. |
are you referring to run a command to adjust the indent of current line? If so add an optional argument to reindent all lines can be a solution. |
Yes, please. Essentially, there should be a way to do 3 things via keyboard shortcuts:
|
Just tried the behavior in 1.14 in a JSON file, it seems that the internal engine for indentation is becoming great but I'm still missing the command(s) to re-indent just the current line or the selection as @vss said. Ctrl+I is actually the very command I have it mapped to :) Actually, thinking about it some more, I very rarely re-indent the whole file and almost always care only about the current line or small chunk of code. So if it was up to me, I'd propose a change of behavior of
Full file re-indentation would be done by simply Ctrl+A and Thanks for your continuing work on this! |
The current behaviour of reindent lines indenting all lines is very confusing. To me the main use for that command would be to reindent blocks after typing in an order not handled by the above improvements. The most common case is wrapping existing code in PR #35594 looks like it changes Reindent Lines to reindent the selection when there is a selection. I think I prefer @borekb's suggestion of reindenting the current line with no selection. The current reindent all feature could be kept as a separate command in which case it should probably be called Reindent Document for consistency with Format Document and to actually be clearly named. I'm not sure if it is also feasible to have Format work over a range? I also notice that reindent lines also doesn't respect This is even more dangerous now that the default behaviour is to not show whitespace changes in diff or the git changes gutter. |
I don't think there is and you're right that it's one of the small but annoying issues with the current implementation. In my own setup, I have |
This issue was created for tracking the todos we were working on auto indentation. Issues mentioned above are being tracked in separate issues so we close this one for better issue tracking. |
Auto indent support for type, move lines and copy/paste
Type
Move Lines
Copy Paste
The text was updated successfully, but these errors were encountered: