|
21 | 21 | from fmtstr.fsarray import FSArray |
22 | 22 | from fmtstr.fmtstr import fmtstr, FmtStr |
23 | 23 | from fmtstr.bpythonparse import parse as bpythonparse |
24 | | -from fmtstr.bpythonparse import func_for_letter |
| 24 | +from fmtstr.bpythonparse import func_for_letter, color_for_letter |
25 | 25 |
|
26 | 26 | from bpython.scrollfrontend.manual_readline import char_sequences as rl_char_sequences |
27 | 27 | from bpython.scrollfrontend.manual_readline import get_updated_char_sequences |
|
41 | 41 | #TODO figure out what config.flush_output is |
42 | 42 | #TODO options.interactive, .quiet |
43 | 43 | #TODO execute file if in args |
44 | | -#TODO prettier completion box! |
45 | 44 | #TODO working raw_input |
46 | 45 |
|
47 | 46 | from bpython.keys import cli_key_dispatch as key_dispatch |
@@ -107,7 +106,7 @@ class Repl(BpythonRepl): |
107 | 106 | outputs: |
108 | 107 | -2D array to be rendered |
109 | 108 |
|
110 | | - Repl is mostly view-indepented state of Repl - but self.width and self.height |
| 109 | + Repl is mostly view-independent state of Repl - but self.width and self.height |
111 | 110 | are important for figuring out how to wrap lines for example. |
112 | 111 | Usually self.width and self.height should be set by receiving a window resize event, |
113 | 112 | not manually set to anything - as long as the first event received is a window |
@@ -514,9 +513,6 @@ def paint(self, about_to_exit=False): |
514 | 513 | less state is cool! |
515 | 514 | """ |
516 | 515 |
|
517 | | - #TODO allow custom background colors? I'm not sure about this |
518 | | - # use fmtstr.bpythonparse.color_for_letter(config.background) -> "black" |
519 | | - |
520 | 516 | if about_to_exit: |
521 | 517 | self.clean_up_current_line_for_exit() # exception to not changing state! |
522 | 518 |
|
@@ -575,6 +571,11 @@ def paint(self, about_to_exit=False): |
575 | 571 |
|
576 | 572 | if show_status_bar and not about_to_exit: |
577 | 573 | arr[max(arr.height, min_height), :] = paint.paint_statusbar(1, width, self.status_bar.current_line, self.config) |
| 574 | + |
| 575 | + |
| 576 | + if self.config.color_scheme['background'] not in ('d', 'D'): |
| 577 | + for r in range(arr.height): |
| 578 | + arr[r] = fmtstr(arr[r], bg=color_for_letter(self.config.color_scheme['background'])) |
578 | 579 | return arr, (cursor_row, cursor_column) |
579 | 580 |
|
580 | 581 | ## Debugging shims |
|
0 commit comments