12/4/2023 0 Comments Visual studio 2022 auto indent![]() This makes sure that what you copy is always what you expect. Selection must start on an empty indentation.In this case, Visual Studio recognizes the pattern and strips the leading indentation from the selection to end up with a well-formatted code snippet.įor Visual Studio to correctly identify when to strip indentation, these conditions must all be true: This pattern is very common when copying code to share it with others in email or IM or elsewhere. Also, all other lines in the selection contain only whitespace in the same span. Notice how the first line of the selection doesn’t have its leading indentation selected. The question is, how does it determine if indentation is unwanted or not? It removes unwanted indentation when you copy text from the editor. We’ve created an extension called Copy Nice for this experiment. Let’s do an experiment to see if we can fix this problem once and for all. In fact, multiple developers have reported this and requested a feature to fix it, so remember to vote for it if you agree. If this has happened to you, you’re not alone. The result looks something like this when you paste it into Outlook: It usually happens because you start your selection without the leading indentation. You know this, yet you make this mistake almost every time. You must now either go back to Visual Studio and do a box selection and copy that, or manually fix the indentation issue in Outlook. ![]() ![]() As you paste it in Outlook/Slack/Teams, you realize that the indentation levels are inconsistent due to your original selection. You want to share some code you’ve written with a colleague, so you select it in the editor and hit Ctrl+ C to copy it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |