Skip to content

Commit 9e0e9c3

Browse files
committed
Fix index out of range error
1 parent c57b80b commit 9e0e9c3

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎nwscript_completion.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,13 @@ def format_popup(self):
107107

108108
if self.text is not None:
109109
text = self._indent_fix(self.text)
110-
for _, name, _ in self.signature[3]:
111-
text = re.sub(
112-
r"\b" + re.escape(name) + r"\b",
113-
'<i><span style="color: var(--orangish)">%s</span></i>' % name,
114-
text
115-
)
110+
if len(self.signature) >= 4:
111+
for _, name, _ in self.signature[3]:
112+
text = re.sub(
113+
r"\b" + re.escape(name) + r"\b",
114+
'<i><span style="color: var(--orangish)">%s</span></i>' % name,
115+
text
116+
)
116117

117118
text_html = (
118119
'<p style="padding: 0 0.5em">%s</p>' % "<br>".join(text.splitlines())

0 commit comments

Comments
 (0)