summaryrefslogtreecommitdiff
path: root/pygments/lexers/matlab.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/matlab.py')
-rw-r--r--pygments/lexers/matlab.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pygments/lexers/matlab.py b/pygments/lexers/matlab.py
index 7790a2ab..b70058c5 100644
--- a/pygments/lexers/matlab.py
+++ b/pygments/lexers/matlab.py
@@ -2776,7 +2776,7 @@ class MatlabSessionLexer(Lexer):
# line = "\n" + line
token = (0, Generic.Traceback, line)
insertions.append((idx, [token]))
- elif continuation:
+ elif continuation and insertions:
# line_start is the length of the most recent prompt symbol
line_start = len(insertions[-1][-1][-1])
# Set leading spaces with the length of the prompt to be a generic prompt