Skip to content

Commit

Permalink
[tests-] since 32f08ea colors need more structure
Browse files Browse the repository at this point in the history
  • Loading branch information
anjakefala committed Oct 18, 2023
1 parent f839433 commit a5d7e90
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion visidata/cliptext.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def clipdraw(scr, y, x, s, attr, w=None, clear=True, literal=False, **kwargs):
return clipdraw_chunks(scr, y, x, chunks, attr, w=w, clear=clear, **kwargs)


def clipdraw_chunks(scr, y, x, chunks, cattr:ColorAttr, w=None, clear=True, literal=False, **kwargs):
def clipdraw_chunks(scr, y, x, chunks, cattr:ColorAttr=ColorAttr(), w=None, clear=True, literal=False, **kwargs):
'''Draw `chunks` (sequence of (color:str, text:str) as from iterchunks) at (y,x)-(y,x+w) with curses `attr`, clipping with ellipsis char.
If `clear`, clear whole editing area before displaying.
Return width drawn (max of w).
Expand Down
2 changes: 1 addition & 1 deletion visidata/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def update(self, b:'ColorAttr') -> 'ColorAttr':
@property
def attr(self) -> int:
a = colors._get_colorpair(self.fg, self.bg, self.colorname) | self.attributes
assert a > 0, a
assert a >= 0, a
return a


Expand Down
2 changes: 1 addition & 1 deletion visidata/tests/test_cliptext.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_clipdraw_chunks(self):
]
scr = Mock()
scr.getmaxyx.return_value = (80,25)
visidata.clipdraw_chunks(scr, 0, 0, prechunks, 0, w=5)
visidata.clipdraw_chunks(scr, 0, 0, prechunks, visidata.ColorAttr(), w=5)
scr.addstr.assert_has_calls([
call(0, 0, 'x', 0),
call(0, 1, 'jso…', 0),
Expand Down

0 comments on commit a5d7e90

Please sign in to comment.