diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2024-11-24 10:19:32 +0100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2024-12-09 22:23:35 +1100 |
| commit | 7105584538f84d1c244809601fd3e573e8d6080c (patch) | |
| tree | ca1e38b5fb7fd6862fb917212af817e3328f1412 /src/client.hh | |
| parent | 816a8c35a8cfa0cc8b7f9d80dd3c0e721ba3c273 (diff) | |
Print elapsed time when blocked on opening file for writing
Extract the logic for "waiting for shell to finish" and reuse it for
potentially blocking calls to open() that use the O_WRONLY flags.
Diffstat (limited to 'src/client.hh')
| -rw-r--r-- | src/client.hh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/client.hh b/src/client.hh index 05b091ae..43584c42 100644 --- a/src/client.hh +++ b/src/client.hh @@ -2,6 +2,7 @@ #define client_hh_INCLUDED #include "array.hh" +#include "clock.hh" #include "display_buffer.hh" #include "env_vars.hh" #include "input_handler.hh" @@ -165,6 +166,19 @@ constexpr auto enum_desc(Meta::Type<Autoreload>) }); } +class BusyIndicator +{ +public: + BusyIndicator(const Context& context, + std::function<DisplayLine(std::chrono::seconds)> status_message, + TimePoint wait_time = Clock::now()); + ~BusyIndicator(); +private: + const Context& m_context; + Timer m_timer; + Optional<DisplayLine> m_previous_status; +}; + } #endif // client_hh_INCLUDED |
