andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 39 forks source link

Syntax highlighter backtrace #418

Closed bjones1 closed 7 years ago

bjones1 commented 7 years ago

I see the following backtrace when editing the attached file. Any ideas?

feedback.zip

Traceback (most recent call last):
  File "E:\Downloads\Anaconda3\lib\site-packages\qutepart-3.0.1-py3.5-win32.egg\qutepart\__init__.py", line 992, in keyPressEvent
    self._insertNewBlock()
  File "E:\Downloads\Anaconda3\lib\site-packages\qutepart-3.0.1-py3.5-win32.egg\qutepart\__init__.py", line 937, in _insertNewBlock
    self._indenter.autoIndentBlock(cursor.block())
  File "E:\Downloads\Anaconda3\lib\site-packages\qutepart-3.0.1-py3.5-win32.egg\qutepart\indenter\__init__.py", line 91, in autoIndentBlock
    indent = self._smartIndenter.computeIndent(block, char)
  File "E:\Downloads\Anaconda3\lib\site-packages\qutepart-3.0.1-py3.5-win32.egg\qutepart\indenter\base.py", line 39, in computeIndent
    return self.computeSmartIndent(block, char)
  File "E:\Downloads\Anaconda3\lib\site-packages\qutepart-3.0.1-py3.5-win32.egg\qutepart\indenter\cstyle.py", line 633, in computeSmartIndent
    return self.indentLine(block, autoIndent)
  File "E:\Downloads\Anaconda3\lib\site-packages\qutepart-3.0.1-py3.5-win32.egg\qutepart\indenter\cstyle.py", line 560, in indentLine
    indent = self.tryStatement(block)
  File "E:\Downloads\Anaconda3\lib\site-packages\qutepart-3.0.1-py3.5-win32.egg\qutepart\indenter\cstyle.py", line 398, in tryStatement
    if currentBlockText[i] == match.group(2) and (i == 0 or currentBlockText[i - 1] != '\\'):
IndexError: string index out of range
andreikop commented 7 years ago

Fixed in Qutepart

bjones1 commented 7 years ago

Looks great! Thanks!