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
Like Marco Buono (@coreh) I'm also interested to know whether this can be a command separate from paste so the user can choose which to use on demand (i.e. one keyboard shortcut for paste, one for paste + format)
Jake Archibald (@jakearchibald) It's not a bug but I can't say it's a feature :( The behavior is consistent with FormatOnType or Save as we hook the formatting handler to Type/Save/Paste event, which makes it two entries in undo/redo stack. cc Johannes Rieken (@jrieken)
Yes, you can disable this formatting using "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false or "typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false
Activity
jrieken commentedon Oct 18, 2016
related to #4039
coreh commentedon Jan 6, 2017
On OS X, could this be mapped to "Paste and Match Style"? ⌥⇧⌘V
jrieken commentedon Jan 12, 2017
Peng Lyu (@rebornix) Do you want me to get started on this? We already have the concept for formatting a range so, my plan is to do the following:
rebornix commentedon Jan 12, 2017
Johannes Rieken (@jrieken) previously I implemented it in another way but we think that's not good, I'll follow your suggestions and do this again :)
Merge pull request #18476 from rebornix/FormatOnPaste
OliverJAsh commentedon Feb 2, 2017
Like Marco Buono (@coreh) I'm also interested to know whether this can be a command separate from paste so the user can choose which to use on demand (i.e. one keyboard shortcut for paste, one for paste + format)
jakearchibald commentedon Feb 2, 2017
Firstly, thanks for adding this, it's been the one feature I really missed from Sublime Text.
Having a play around with it, it seems to create two entries into undo history per single paste. I can't decide if that's a bug or a feature.
rebornix commentedon Feb 6, 2017
Jake Archibald (@jakearchibald) It's not a bug but I can't say it's a feature :( The behavior is consistent with FormatOnType or Save as we hook the formatting handler to Type/Save/Paste event, which makes it two entries in undo/redo stack. cc Johannes Rieken (@jrieken)
jakearchibald commentedon Feb 8, 2017
Another "is this a bug or not?"
If I paste:
It adds a space between
functionand(event). I didn't expect it to do that.rebornix commentedon Feb 8, 2017
Matt Bierner (@mjbvz) I suppose what Jake Archibald (@jakearchibald) mentioned is actually TypeScript formatter's default behavior, right?
mjbvz commentedon Feb 8, 2017
Yes, you can disable this formatting using
"javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": falseor"typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": falsefix microsoft#13945. support format on paste
Merge pull request microsoft#18476 from rebornix/FormatOnPaste