-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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
Auto-indent on paste #25260
Comments
fyi @rebornix |
@poklau123 About the "first line" question: You have copied the first line without the indention, but the second line with the indention, so of course the idention is unequal after pasting. To have it equal, you need to copy both lines with indention (e.g. by using the left border of the code window where the mouse cursor points right). In general, though, I am also missing a way to auto-indent after paste. There have been various issues in GitHub about this before (see also #13945), and in January an option was added to do "Format on Paste" ( My solution for now is the plugin Paste and Indent. I have changed the key bindings so that Ctrl+V does normal paste while Ctrl+Shift+V invokes |
@CherryDT Thanks for your advice! It's better for me to set option update: I just found out the option |
@poklau123 I was also experimenting with I'm also a bit confusing about the paste&format thing. When the discussion stared it was related to paste&indent, but then the paste&format discussion started and took over like a more advanced replacement, but I still believe paste&indent should be part of the editor for cases on where you don't want to format, but also, for languages that have no suitable formatter available, like SCSS. |
@druellan I agree, that's what I meant in my comment above and that's why I ended up using the Paste and Ident extension. |
Already added this feature in Insider build, thanks! |
Steps to Reproduce:
1.Create a file named 'test.php', and type some code like this:
![image](https://cloud.githubusercontent.com/assets/7621696/25366098/f7417b4e-299f-11e7-96ac-0b061390975c.png)
2.When I try to paste these selected multiline code to the first line of function 'test', it shows:
![image](https://cloud.githubusercontent.com/assets/7621696/25366148/5724212e-29a0-11e7-85af-55c7a6530b8d.png)
Why do not auto-indent except the first line of pasted codes?
The text was updated successfully, but these errors were encountered: