vscode-twig-language-2
vscode-twig-language-2 copied to clipboard
Format on paste doesn't adhere to current tab depth
If pasting code in and the editor is formatting on paste, the code will always be reset to no tab depth. Even the simplest pasting of one random character will reset the whole line's tab depth to 0 characters/tabs.
I can confirm this issue.
I am experiencing the same.
Any solution yet? Having the same issue
As much as it killed me to do so, I removed the extension. I have a feeling @mblode may have moved onto some bigger fish, but this project is a great start for a fork.
Same here. Anyone find a fix or workaround for this?
Hey guys, I have just pushed an update to Twig Language 2 with a brand new formatter using Prettydiff 3 which brings about some major bug fixes along with fixing this indentation issue. Please let me know if you are still having issues. Sorry about the lack of communication and slow development speeds but hopefully these updates have fixed some of your problems.
@mblode ~Looks like initial "paste point" is correct now, but the formatter will do a line break unnecessarily (which is another issue by itself) which seems to ignore the tab depth.~
EDIT: I can't confidently say anything changed with this last update as I just realized Prettier was running on paste and interfering as well. I the "paste point" observation was based on a race condition between Prettier and this twig formatter. Disabling Prettier brings back the same behavior as before.
Hmmm yeah, I had realised that on testing 2 days ago and haven't had a chance to look into it any further. But I'll do some research now and hopefully push a fix in the next couple of days. 👍
@mblode Thanks for your continued work on this man!
I'm having the same issues as described. When I paste, it will remove any indentation. Hitting "command + Z" will then re-indent the line to the appropriate place.
I've tried enabling/disabling Prettier and changing some of the settings but can't seem to narrow down the issue.
Thanks in advance for any thoughts or help!
@mblode Is it be possible to override VSCode's Editor setting for "Format on Paste"? Unfortunately, disabling Format on Paste would disable that functionality globally.
When I paste, not only does it reset the indentation, it adds a blank line below.
Any fix for this would be greatly appreciated :)
Stale issue message
same issue as @Flowgram
@peterchang2 this extension has been kind of abandoned. I've since moved to using Prettier and https://github.com/trivago/prettier-plugin-twig-melody