Skip to content

Commit 5e5b672

Browse files
committed
fix 'reverse' text attr
1 parent 7c27061 commit 5e5b672

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

neovim/ui/gtk_ui.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,12 +468,14 @@ def _get_pango_attrs(self, attrs):
468468
'background': _split_color(bg),
469469
}
470470
if attrs:
471+
# make sure that foreground and background are assigned first
472+
for k in ['foreground', 'background']:
473+
if k in attrs:
474+
n[k] = _split_color(attrs[k])
471475
for k, v in attrs.items():
472-
if k in ['foreground', 'background']:
473-
n[k] = _split_color(v)
474-
elif k == 'reverse':
475-
n['foreground'] = _invert_color(*n['foreground'])
476-
n['background'] = _invert_color(*n['background'])
476+
if k == 'reverse':
477+
n['foreground'], n['background'] = \
478+
n['background'], n['foreground']
477479
elif k == 'italic':
478480
n['font_style'] = 'italic'
479481
elif k == 'bold':

0 commit comments

Comments
 (0)