Skip to content
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

Can't type the closing paren when paren's color is set to default. #873

Closed
mrillusi0n opened this issue Jan 5, 2021 · 0 comments
Closed
Labels
Milestone

Comments

@mrillusi0n
Copy link

I get the following error when trying to pair an opened paren.

>>> print(
Traceback (most recent call last):
  File "/usr/local/bin/bpython", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bpython/curtsies.py", line 191, in main
    exit_value = repl.mainloop(True, paste)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bpython/curtsies.py", line 123, in mainloop
    self.process_event_and_paint(e)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bpython/curtsies.py", line 100, in process_event_and_paint
    array, cursor_pos = self.paint()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bpython/curtsiesfrontend/repl.py", line 1316, in paint
    self.current_cursor_line)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bpython/curtsiesfrontend/repl.py", line 1246, in current_cursor_line
    return (self.current_cursor_line_without_suggestion +
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bpython/curtsiesfrontend/repl.py", line 1237, in current_cursor_line_without_suggestion
    self.display_line_with_prompt))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bpython/curtsiesfrontend/repl.py", line 1230, in display_line_with_prompt
    self.current_line_formatted)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bpython/curtsiesfrontend/repl.py", line 1180, in current_line_formatted
    fs = bpythonparse(format(self.tokenize(self.current_line),
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bpython/curtsiesfrontend/parse.py", line 40, in parse
    return (sum((fs_from_match(d) for d in stuff[1:]), fs_from_match(stuff[0]))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bpython/curtsiesfrontend/parse.py", line 40, in <genexpr>
    return (sum((fs_from_match(d) for d in stuff[1:]), fs_from_match(stuff[0]))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bpython/curtsiesfrontend/parse.py", line 60, in fs_from_match
    color = colors[(colors.index(color) + (len(colors) // 2)) %
ValueError: tuple.index(x): x not in tuple
gruv.theme
# Each letter represents a colour marker:
#   k, r, g, y, b, m, c, w, d
# which stands for:
#   blacK, Red, Green, Yellow, Blue, Magenta, Cyan, White, Default
# Capital letters represent bold
# Copy to $XDG_CONFIG_HOME/bpython/foo.theme and set "color_scheme = foo" in
# $XDG_CONFIG_HOME/bpython/config ($XDG_CONFIG_HOME defaults to ~/.config)

[syntax]
keyword = r
name = g
comment = b
string = m
error = r
number = g
operator = Y
punctuation = y
token = c
paren = d # cause of error as observed 

[interface]
# XXX: gnome-terminal appears to be braindead. The cursor will disappear unless
# you set the background colour to "d".
background = d
output = w
main = c
prompt = c
prompt_more = g
right_arrow_suggestion = k
@sebastinas sebastinas added the bug label Jan 5, 2021
@sebastinas sebastinas added this to the release-0.21 milestone Jan 5, 2021
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

2 participants