Merge branch 'unicode_input-reverse' of https://github.com/blueyed/kitty
This commit is contained in:
@@ -165,21 +165,20 @@ class Table:
|
|||||||
|
|
||||||
def cell(i, idx, c, desc):
|
def cell(i, idx, c, desc):
|
||||||
is_current = i == self.current_idx
|
is_current = i == self.current_idx
|
||||||
if is_current:
|
text = colored(idx, 'green') + ' ' + sgr('49') + c + ' '
|
||||||
yield sgr(color_code('gray', base=40))
|
|
||||||
yield colored(idx, 'green') + ' '
|
|
||||||
yield colored(c, 'black' if is_current else 'gray', True) + ' '
|
|
||||||
w = wcswidth(c)
|
w = wcswidth(c)
|
||||||
if w < 2:
|
if w < 2:
|
||||||
yield ' ' * (2 - w)
|
text += ' ' * (2 - w)
|
||||||
if len(desc) > space_for_desc:
|
if len(desc) > space_for_desc:
|
||||||
desc = desc[:space_for_desc - 1] + '…'
|
text += desc[:space_for_desc - 1] + '…'
|
||||||
yield faint(desc)
|
else:
|
||||||
|
text += desc
|
||||||
extra = space_for_desc - len(desc)
|
extra = space_for_desc - len(desc)
|
||||||
if extra > 0:
|
if extra > 0:
|
||||||
yield ' ' * extra
|
text += ' ' * extra
|
||||||
if is_current:
|
|
||||||
yield sgr('49')
|
yield styled(text, reverse=True if is_current else None)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
def as_parts(i, codepoint):
|
def as_parts(i, codepoint):
|
||||||
return encode_hint(i).ljust(idx_size), chr(codepoint), ''
|
return encode_hint(i).ljust(idx_size), chr(codepoint), ''
|
||||||
|
|||||||
Reference in New Issue
Block a user