mirror of
https://github.com/powerline/powerline.git
synced 2025-07-19 20:04:56 +02:00
Also do the same for last_pipe_status
This commit is contained in:
parent
4e5bd54f79
commit
691efbfc9b
@ -22,7 +22,7 @@ def last_pipe_status(pl, segment_info):
|
||||
'''
|
||||
last_pipe_status = segment_info['args'].last_pipe_status
|
||||
if any(last_pipe_status):
|
||||
return [{"contents": str(status), "highlight_group": "exit_fail" if status else "exit_success"}
|
||||
return [{'contents': str(status), 'highlight_group': 'exit_fail' if status else 'exit_success', 'draw_inner_divider': True}
|
||||
for status in last_pipe_status]
|
||||
else:
|
||||
return None
|
||||
|
@ -29,10 +29,11 @@ class TestShell(TestCase):
|
||||
segment_info['args'].last_pipe_status = [0, 0, 0]
|
||||
self.assertEqual(shell.last_pipe_status(pl=pl, segment_info=segment_info), None)
|
||||
segment_info['args'].last_pipe_status = [0, 2, 0]
|
||||
self.assertEqual(shell.last_pipe_status(pl=pl, segment_info=segment_info),
|
||||
[{'contents': '0', 'highlight_group': 'exit_success'},
|
||||
{'contents': '2', 'highlight_group': 'exit_fail'},
|
||||
{'contents': '0', 'highlight_group': 'exit_success'}])
|
||||
self.assertEqual(shell.last_pipe_status(pl=pl, segment_info=segment_info), [
|
||||
{'contents': '0', 'highlight_group': 'exit_success', 'draw_inner_divider': True},
|
||||
{'contents': '2', 'highlight_group': 'exit_fail', 'draw_inner_divider': True},
|
||||
{'contents': '0', 'highlight_group': 'exit_success', 'draw_inner_divider': True}
|
||||
])
|
||||
|
||||
|
||||
class TestCommon(TestCase):
|
||||
|
Loading…
x
Reference in New Issue
Block a user