X Tutup
Skip to content

Crash on multiline rewind of line containing opening and closing parens #448

@thomasballinger

Description

@thomasballinger
>>> for line in f:
...        a() |
Traceback (most recent call last):
  File "/Users/tomb/.virtualenvs/bpython/bin/bpython", line 9, in <module>
    load_entry_point('bpython==0.13-363', 'console_scripts', 'bpython')()
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsies.py", line 69, in main
    mainloop(config, locals_, banner, interp, paste, interactive=(not exec_args))
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsies.py", line 147, in mainloop
    process_event(e)
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsies.py", line 126, in process_event
    repl.process_event(e)
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 436, in process_event
    return self.process_key_event(e)
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 540, in process_key_event
    self.undo()
  File "/Users/tomb/Dropbox/code/bpython/bpython/repl.py", line 802, in undo
    self.take_back_buffer_line()
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 1276, in take_back_buffer_line
    self._set_cursor_offset(0, update_completion=False)
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 1246, in _set_cursor_offset
    self.unhighlight_paren()
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 887, in unhighlight_paren
    self.display_buffer[lineno] = self.display_buffer[lineno].setslice_with_length(0, len(new), new, len(self.display_buffer[lineno]))
IndexError: list index out of range

where | is the cursor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup