summaryrefslogtreecommitdiff
path: root/pygments/lexers/matlab.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2022-06-23 08:49:14 +0200
committerGeorg Brandl <georg@python.org>2022-06-23 08:49:14 +0200
commit7c8aabf30b2305b52bf00538c7d742d4d335277f (patch)
tree35335c459cb16e2ee94098eee04b4a1522d1c5be /pygments/lexers/matlab.py
parentaf9dc424e1a0af62a7682c9496b7a23423cf2f82 (diff)
downloadpygments-git-7c8aabf30b2305b52bf00538c7d742d4d335277f.tar.gz
Matlab session: fix traceback when a line continuation ellipsis appears in the output
Fixes #2166
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