diff options
author | Tim Schumacher <timschumi@gmx.de> | 2023-01-13 12:29:46 +0100 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2023-01-16 21:04:48 +0000 |
commit | 40cb41a16cf0cb6b2711eb5be6facddd2540e13a (patch) | |
tree | 6d44889cb65ae06dcac44ddab0ef2cdf5f5f70a6 /Userland/Libraries/LibLine/SuggestionDisplay.h | |
parent | f9f1e1dd4956c92ca33f8562739f224d6e80c323 (diff) | |
download | serenity-40cb41a16cf0cb6b2711eb5be6facddd2540e13a.zip |
LibLine: Do a whole bunch of internal error propagation
Diffstat (limited to 'Userland/Libraries/LibLine/SuggestionDisplay.h')
-rw-r--r-- | Userland/Libraries/LibLine/SuggestionDisplay.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Userland/Libraries/LibLine/SuggestionDisplay.h b/Userland/Libraries/LibLine/SuggestionDisplay.h index 113df0ccfb..99ee3ae1e4 100644 --- a/Userland/Libraries/LibLine/SuggestionDisplay.h +++ b/Userland/Libraries/LibLine/SuggestionDisplay.h @@ -18,20 +18,22 @@ class Editor; class SuggestionDisplay { public: virtual ~SuggestionDisplay() = default; - virtual void display(SuggestionManager const&) = 0; - virtual bool cleanup() = 0; + virtual ErrorOr<void> display(SuggestionManager const&) = 0; + virtual ErrorOr<bool> cleanup() = 0; virtual void finish() = 0; virtual void set_initial_prompt_lines(size_t) = 0; - void redisplay(SuggestionManager const& manager, size_t lines, size_t columns) + ErrorOr<void> redisplay(SuggestionManager const& manager, size_t lines, size_t columns) { if (m_is_showing_suggestions) { - cleanup(); + TRY(cleanup()); set_vt_size(lines, columns); - display(manager); + TRY(display(manager)); } else { set_vt_size(lines, columns); } + + return {}; } virtual void set_vt_size(size_t lines, size_t columns) = 0; @@ -62,8 +64,8 @@ public: { } virtual ~XtermSuggestionDisplay() override = default; - virtual void display(SuggestionManager const&) override; - virtual bool cleanup() override; + virtual ErrorOr<void> display(SuggestionManager const&) override; + virtual ErrorOr<bool> cleanup() override; virtual void finish() override { m_pages.clear(); |