src/eric7/QScintilla/Editor.py

branch
eric7
changeset 10341
3fdffd9cc21d
parent 10331
c1a2ff7e3575
child 10343
d7d52b0b4448
--- a/src/eric7/QScintilla/Editor.py	Fri Nov 24 14:59:26 2023 +0100
+++ b/src/eric7/QScintilla/Editor.py	Sat Nov 25 18:19:21 2023 +0100
@@ -6710,6 +6710,11 @@
         if line == 0:
             line = 1
             # hack to show a syntax error marker, if line is reported to be 0
+
+        line = min(line, self.lines())
+        # Limit the line number to the ones we really have to ensure proper display
+        # of the error annotation.
+
         if setError:
             # set a new syntax error marker
             markers = self.markersAtLine(line - 1)
@@ -6864,6 +6869,11 @@
         if line == 0:
             line = 1
             # hack to show a warning marker, if line is reported to be 0
+
+        line = min(line, self.lines())
+        # Limit the line number to the ones we really have to ensure proper display
+        # of the warning annotation.
+
         if setWarning:
             # set/amend a new warning marker
             warn = (msg, warningType)

eric ide

mercurial