Skip to content

Commit a6d0aa1

Browse files
committed
Fix a typo and off-by-one in paren highlighting.
1 parent 76edf48 commit a6d0aa1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

bpython/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,6 +1657,8 @@ def reprint_line(lineno, s, to_replace=[]):
16571657
map(self.echo, o.split('\x04'))
16581658

16591659
y, x = self.scr.getyx()
1660+
if not self.cpos:
1661+
x += 1
16601662
if self.highlighted_paren:
16611663
# Clear previous highlighted paren
16621664
reprint_line(*self.highlighted_paren)

bpython/formatter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def __init__(self, color_scheme, **options):
9393
if not self.f_strings:
9494
for k, v in theme_map.iteritems():
9595
self.f_strings[k] = '\x01%s' % (color_scheme[v],)
96-
if k is Parenthesis:
96+
if k is Parenthesis or k is Parenthesis.UnderCursor:
9797
# FIXME: Find a way to make this the inverse of the current
9898
# background colour
9999
self.f_strings[k] += 'I'
@@ -106,7 +106,7 @@ def format(self, tokensource, outfile):
106106
if text == '\n':
107107
continue
108108

109-
if token is Parenthesis.UnderCorsor:
109+
if token is Parenthesis.UnderCursor:
110110
curses.curs_set(0)
111111

112112
if token in self.f_strings:

0 commit comments

Comments
 (0)