diff options
author | Mats Larsen <me@supergrecko.com> | 2021-10-27 09:58:38 +0200 |
---|---|---|
committer | Mats Larsen <me@supergrecko.com> | 2021-10-27 09:58:38 +0200 |
commit | 4a420bf124bddde2aa017de81e8eee2fec6aa648 (patch) | |
tree | cb5841a2f261837c0460a54b4b1445f8f3e2be4c | |
parent | 68f37f8c68e2c5794c9aae0838b5459ef882a4e1 (diff) | |
download | compiler-explorer-gh-1206.tar.gz compiler-explorer-gh-1206.zip |
Implement fix for #3065gh-1206
-rw-r--r-- | lib/handlers/formatting.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/handlers/formatting.js b/lib/handlers/formatting.js index 39db585ca..c0616aba9 100644 --- a/lib/handlers/formatting.js +++ b/lib/handlers/formatting.js @@ -95,13 +95,13 @@ export class FormattingHandler { try { // Perform the actual formatting const result = await formatter.format(req.body.source, { - useSpaces: req.body.useSpaces, - tabWidth: req.body.tabWidth, + useSpaces: req.body.useSpaces ? req.body.useSpaces : true, + tabWidth: req.body.tabWidth ? req.body.tabWidth: 4, baseStyle: req.body.base, }); res.send({ exit: result.code, - answer: result.stdout || '', + answer: result.stdout || result.stderr || '', }); } catch (err) { res.status(500).send({ |