From 829e47c75a0f047b7ec20b3f4ca2ea825e5ef7d3 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Thu, 1 Apr 2021 14:24:31 -0500 Subject: [PATCH] Wrap long lines in compiler error This way we don't overflow the toast. --- src/notifications/sagas.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/notifications/sagas.ts b/src/notifications/sagas.ts index 74aa93fb..5ecb6b8d 100644 --- a/src/notifications/sagas.ts +++ b/src/notifications/sagas.ts @@ -316,7 +316,11 @@ function* dismissCompilerError(): Generator { function* showCompilerError(action: MpyDidFailToCompileAction): Generator { yield* showSingleton(Level.Error, MessageId.MpyError, { - errorMessage: React.createElement('pre', undefined, action.err.join('\n')), + errorMessage: React.createElement( + 'pre', + { style: { whiteSpace: 'pre-wrap', wordBreak: 'keep-all' } }, + action.err.join('\n'), + ), }); }