X Tutup
Skip to content

Completion updated at inappropriate times #471

@thomasballinger

Description

@thomasballinger

update_completion called when current_line updated, but cursor_pos not updated, so cursor_pos < len(current_line)

>>> def foo():
...
...     return 1
...
>>>
Traceback (most recent call last):
  File "/Users/tomb/.virtualenvs/bpython/bin/bpython", line 9, in <module>
    load_entry_point('bpython==0.13-463', 'console_scripts', 'bpython')()
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsies.py", line 70, in main
    mainloop(config, locals_, banner, interp, paste, interactive=(not exec_args))
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsies.py", line 154, in mainloop
    process_event(e)
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsies.py", line 117, in process_event
    repl.process_event(e)
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 435, in process_even
t
    return self.process_key_event(e)
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 548, in process_key_
event
    self.prompt_undo()
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 1307, in prompt_undo
    self.reevaluate()
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 1337, in reevaluate
    self.current_line = line
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 1243, in _set_curren
t_line
    self.update_completion()
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 801, in update_compl
etion
    self.list_win_visible = BpythonRepl.complete(self, tab)
  File "/Users/tomb/Dropbox/code/bpython/bpython/repl.py", line 572, in complete
    history=self.history)
  File "/Users/tomb/Dropbox/code/bpython/bpython/autocomplete.py", line 447, in get_completer_bpython
    return get_completer(BPYTHON_COMPLETER, cursor_offset, line, **kwargs)
  File "/Users/tomb/Dropbox/code/bpython/bpython/autocomplete.py", line 427, in get_completer
    cursor_offset, line, **kwargs)
  File "/Users/tomb/Dropbox/code/bpython/bpython/autocomplete.py", line 399, in matches
    line)
AssertionError: 4 ''
(bpython)tom-mba:bpython tomb$

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup