plievone / vscode-template-literal-editor

Extension to VS Code. Use Ctrl+Enter to open ES6 template literals and other configured multi-line strings or heredocs in any language in a synced editor, with language support (HTML, CSS, SQL, shell, markdown etc).
https://marketplace.visualstudio.com/items?itemName=plievone.vscode-template-literal-editor
55 stars 5 forks source link

Can you keep the original tab in the source file? #21

Open Qsppl opened 7 months ago

Qsppl commented 7 months ago

When I open the editor for html, the tabulation in the created file is broken: image

Moreover, if you format the document... image ...the tabulation in the original document is broken. image

Nu11u5 commented 4 months ago

The text block starts immediately after the quote/backtick. In your example this shows up as an empty first line in the editor since the only thing following the backtick is a line return. When you autoformat the text this operation is deleting the line return, so when the extension write it back your HTML text starts immediately after the backtick.

The extension would need to preserve these beginning and ending line returns, and omit them from the editor so formatting operations can't remove them accidentally. Handling the indentation similarly would be welcome as well.