# HG changeset patch # User Teemu Piippo # Date 1418633516 -7200 # Node ID 052393cf90163767875f27810c1a644fe5199ff9 # Parent 80b26bc9707a6523bbecfe413a44239425e5b246 - add support for SVRC_TOOMANYTABCOMPLETES diff -r 80b26bc9707a -r 052393cf9016 sources/interface.cpp --- a/sources/interface.cpp Mon Dec 15 10:31:52 2014 +0200 +++ b/sources/interface.cpp Mon Dec 15 10:51:56 2014 +0200 @@ -945,12 +945,15 @@ // ------------------------------------------------------------------------------------------------- // FUNCTION -Interface::tab_complete (const String& part, const String& complete) -> void +Interface::tab_complete (const String& part, String complete) -> void { String& input = mutable_current_input(); if (input.starts_with (part)) { + if (input[part.length()] != ' ') + complete += ' '; + input.replace (0, part.length(), complete); g_cursor = complete.length(); g_needInputRender = true; diff -r 80b26bc9707a -r 052393cf9016 sources/interface.h --- a/sources/interface.h Mon Dec 15 10:31:52 2014 +0200 +++ b/sources/interface.h Mon Dec 15 10:51:56 2014 +0200 @@ -41,5 +41,5 @@ FUNCTION update_statusbar() -> void; FUNCTION connect (String address, String password) -> void; FUNCTION need_refresh() -> void; - FUNCTION tab_complete (const String& part, const String& complete) -> void; + FUNCTION tab_complete (const String& part, String complete) -> void; }; diff -r 80b26bc9707a -r 052393cf9016 sources/network/rconsession.cpp --- a/sources/network/rconsession.cpp Mon Dec 15 10:31:52 2014 +0200 +++ b/sources/network/rconsession.cpp Mon Dec 15 10:51:56 2014 +0200 @@ -188,6 +188,14 @@ process_server_updates (packet); break; + case SVRC_TOOMANYTABCOMPLETES: + { + unsigned int numCompletions = packet.read_short(); + print ("%1 completions for '%2'.\n", + int (numCompletions), m_lastTabComplete); + } + break; + case SVRC_TABCOMPLETE: { StringList completes; diff -r 80b26bc9707a -r 052393cf9016 sources/network/rconsession.h --- a/sources/network/rconsession.h Mon Dec 15 10:31:52 2014 +0200 +++ b/sources/network/rconsession.h Mon Dec 15 10:51:56 2014 +0200 @@ -52,6 +52,7 @@ SVRC_MESSAGE, SVRC_UPDATE, SVRC_TABCOMPLETE, + SVRC_TOOMANYTABCOMPLETES, }; // -------------------------------------------------------------------------------------------------