Skip to content

Another unhighlight_paren bug #468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thomasballinger opened this issue Jan 29, 2015 · 1 comment
Closed

Another unhighlight_paren bug #468

thomasballinger opened this issue Jan 29, 2015 · 1 comment
Labels

Comments

@thomasballinger
Copy link
Member

(bpython)tom-mba:~ tomb$ bpython
bpython version 0.13-463 on top of Python 2.7.5 /Users/tomb/.virtualenvs/bpython/bin/python2.7
>>> print inspect.getsource(inspect.getsourcelines)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'inspect' is not defined
>>> inspect
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_event
    return self.process_key_event(e)
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 542, in process_key_event
    self.on_enter()
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 618, in on_enter
    self.push(self.current_line, insert_into_history=insert_into_history)
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 848, in push
    self.cursor_offset = 0
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 1265, in _set_cursor_offset
    self.unhighlight_paren()
  File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 900, in unhighlight_paren
    self.display_buffer[lineno] = self.display_buffer[lineno].setslice_with_length(0, len(new), new, len(self.display_buffer[lineno]))
  File "/Users/tomb/.virtualenvs/bpython/lib/python2.7/site-packages/curtsies/formatstring.py", line 174, in setslice_with_length
    assert len(result) <= length
AssertionError
(bpython)tom-mba:~ tomb$
@thomasballinger
Copy link
Member Author

planning to look at this tomorrow, and will add a precondition to unhighlight_paren to help highlight these better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant