- add support for SVRC_TOOMANYTABCOMPLETES experimental

Mon, 15 Dec 2014 10:51:56 +0200

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Mon, 15 Dec 2014 10:51:56 +0200
branch
experimental
changeset 39
052393cf9016
parent 38
80b26bc9707a
child 40
cf85b5f77541

- add support for SVRC_TOOMANYTABCOMPLETES

sources/interface.cpp file | annotate | diff | comparison | revisions
sources/interface.h file | annotate | diff | comparison | revisions
sources/network/rconsession.cpp file | annotate | diff | comparison | revisions
sources/network/rconsession.h file | annotate | diff | comparison | revisions
--- 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;
--- 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;
 };
--- 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;
--- 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,
 };
 
 // -------------------------------------------------------------------------------------------------

mercurial