openhab / openhab-vscode

VS Code extension for openHAB configuration files
https://marketplace.visualstudio.com/items?itemName=openhab.openhab
Eclipse Public License 2.0
159 stars 47 forks source link

Add newlines to newly inserted items #121

Closed MHerbst closed 5 years ago

MHerbst commented 5 years ago

If you use the functions "Create items from channels" (for Things) resp. "Insert into Sitemap" (for Items) the new definitions are pasted into the .items resp. .sitemap files without a newline at the end of the definition. If you want to insert multiple items (one after the other) you always have click into the text editor and press the return key to get a new line before you insert a new item. This is quite annoying if you want to insert multiple items.

Therefore I would like to have an option where you specify whether a newline should be inserted automatically or not.

Confectrician commented 5 years ago

Good point.

Additionally we have #47 which needs to have some newline attention too. I didn't investigate time yet, but this could maybe solved in the same code parts.

MHerbst commented 5 years ago

I did not have a look #47 yet. But I agree, that the implementation could be quite similar.

ghost commented 5 years ago

It's actually really simple. I just needed to add a single \n

kubawolanin commented 5 years ago

Closed with #136