Make TUI react to "set style enabled"
authorTom Tromey <tromey@adacore.com>
Fri, 8 Mar 2019 20:41:55 +0000 (13:41 -0700)
committerTom Tromey <tromey@adacore.com>
Thu, 14 Mar 2019 11:51:10 +0000 (05:51 -0600)
commit3768f5bdec2ed46e7c3c07c863cebd99a5efe645
treef1b7158b8edcec2d56442f1ebcfdf298612d20a9
parentfe22e9649ff6d6b9ee6d72aa97fe415581435b4b
Make TUI react to "set style enabled"

When the user toggles "set style enabled", the TUI should react by
redrawing the source window, if necessary.  This patch implements this
behavior.

No test because the TUI is generally not tested.

This version of the patch incorporates Pedro's patch to provide a
clean way to force the TUI to update the source window's contents.

2019-03-14  Pedro Alves  <palves@redhat.com>
    Tom Tromey  <tromey@adacore.com>

* tui/tui-winsource.h (tui_refill_source_window): Declare.
* tui/tui-winsource.c (tui_refill_source_window): New function,
from...
(tui_horizontal_source_scroll): ... here.  Move some logic.
* cli/cli-style.c (set_style_enabled): Notify new observable.
* tui/tui-hooks.c (tui_redisplay_source): New function.
(tui_attach_detach_observers): Attach or detach
tui_redisplay_source.
* observable.h (source_styling_changed): New observable.
* observable.c: Define source_styling_changed observable.
gdb/ChangeLog
gdb/cli/cli-style.c
gdb/observable.c
gdb/observable.h
gdb/tui/tui-hooks.c
gdb/tui/tui-winsource.c
gdb/tui/tui-winsource.h