Just checked an idea for "format only the selected code" in my environment.
At the end it is extremly easy to implement.
Should be similiar for prettier
if(selected) code = code.replace(selected,js_beautify(selected,options) + "\n"); //had to add linefeed for beautify, don't know wether prettier needs this
else code = js_beautify(code,options);
© Espruino, powered by microcosm.
Report a problem