diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-09-16 19:15:13 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-09-16 19:15:13 +0100 |
| commit | 06e06d6ea67f10ececd7232471505e7d8f36d509 (patch) | |
| tree | 478b39028f534bb6b89b16ffcffa54c83c61b3c2 /src/remote.cc | |
| parent | 49903523a7f28c18d324bf605876b9d18a97047b (diff) | |
remove print_status from UserInterface, pass status line to draw
Client store the current status line. This way calls to print status
do not force the user interface to display directly.
Diffstat (limited to 'src/remote.cc')
| -rw-r--r-- | src/remote.cc | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/remote.cc b/src/remote.cc index 39542a0b..cb55bb8e 100644 --- a/src/remote.cc +++ b/src/remote.cc @@ -20,7 +20,6 @@ namespace Kakoune enum class RemoteUIMsg { - PrintStatus, MenuShow, MenuSelect, MenuHide, @@ -217,8 +216,6 @@ public: RemoteUI(int socket); ~RemoteUI(); - void print_status(const DisplayLine& status) override; - void menu_show(memoryview<String> choices, DisplayCoord anchor, ColorPair fg, ColorPair bg, MenuStyle style) override; @@ -230,6 +227,7 @@ public: void info_hide() override; void draw(const DisplayBuffer& display_buffer, + const DisplayLine& status_line, const DisplayLine& mode_line) override; bool is_key_available() override; @@ -257,13 +255,6 @@ RemoteUI::~RemoteUI() close(m_socket_watcher.fd()); } -void RemoteUI::print_status(const DisplayLine& status) -{ - Message msg(m_socket_watcher.fd()); - msg.write(RemoteUIMsg::PrintStatus); - msg.write(status); -} - void RemoteUI::menu_show(memoryview<String> choices, DisplayCoord anchor, ColorPair fg, ColorPair bg, MenuStyle style) @@ -308,11 +299,13 @@ void RemoteUI::info_hide() } void RemoteUI::draw(const DisplayBuffer& display_buffer, + const DisplayLine& status_line, const DisplayLine& mode_line) { Message msg(m_socket_watcher.fd()); msg.write(RemoteUIMsg::Draw); msg.write(display_buffer); + msg.write(status_line); msg.write(mode_line); } @@ -385,12 +378,6 @@ void RemoteClient::process_next_message() RemoteUIMsg msg = read<RemoteUIMsg>(socket); switch (msg) { - case RemoteUIMsg::PrintStatus: - { - auto status = read<DisplayLine>(socket); - m_ui->print_status(status); - break; - } case RemoteUIMsg::MenuShow: { auto choices = read_vector<String>(socket); @@ -422,8 +409,9 @@ void RemoteClient::process_next_message() case RemoteUIMsg::Draw: { auto display_buffer = read<DisplayBuffer>(socket); + auto status_line = read<DisplayLine>(socket); auto mode_line = read<DisplayLine>(socket); - m_ui->draw(display_buffer, mode_line); + m_ui->draw(display_buffer, status_line, mode_line); break; } } |
