From 051cb27f9b7a036b3da9b7d936adbc7e31e232db Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 13 Apr 2020 14:26:17 -0400 Subject: [PATCH] Fix syntax highlighting of line continuation Thix fixes an exception being thrown when the line being continued is the last one. --- src/js/codemirror/ubo-static-filtering.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/codemirror/ubo-static-filtering.js b/src/js/codemirror/ubo-static-filtering.js index bc71dfc30..08bea84a3 100644 --- a/src/js/codemirror/ubo-static-filtering.js +++ b/src/js/codemirror/ubo-static-filtering.js @@ -121,7 +121,10 @@ CodeMirror.defineMode("ubo-static-filtering", function() { if ( line.endsWith(' \\') ) { do { line = stream.lookAhead(lines.length); - if ( line.startsWith(' ') === false ) { break; } + if ( + line === undefined || + line.startsWith(' ') === false + ) { break; } lines.push(line); } while ( line.endsWith(' \\') ); }