Fixed: sending a message from earlier history did not flush to a new input line, instead just up a single level in history

Mon, 11 Jan 2016 02:26:23 +0200

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Mon, 11 Jan 2016 02:26:23 +0200
changeset 116
552909484712
parent 115
bb7ef7c33dad
child 117
39e05a6ba8d7

Fixed: sending a message from earlier history did not flush to a new input line, instead just up a single level in history

sources/interface.cpp file | annotate | diff | comparison | revisions
sources/interface.h file | annotate | diff | comparison | revisions
--- a/sources/interface.cpp	Mon Jan 11 02:14:33 2016 +0200
+++ b/sources/interface.cpp	Mon Jan 11 02:26:23 2016 +0200
@@ -830,13 +830,11 @@
 			if (current_input()[0] == '/')
 			{
 				handle_command(current_input());
-				InputHistory.insert (0, "");
-				NeedInputRender = true;
+				flush_input();
 			}
 			else if (Session.send_command (current_input()))
 			{
-				InputHistory.insert (0, "");
-				NeedInputRender = true;
+				flush_input();
 			}
 			break;
 		}
@@ -1116,4 +1114,13 @@
 	Title.sprintf (APPNAME " %s (%s)", full_version_string(), changeset_date_string());
 }
 
+// -------------------------------------------------------------------------------------------------
+//
+void Interface::flush_input()
+{
+	InputHistory.insert (0, "");
+	InputCursor = 0;
+	NeedInputRender = true;
+}
+
 END_ZFC_NAMESPACE
--- a/sources/interface.h	Mon Jan 11 02:14:33 2016 +0200
+++ b/sources/interface.h	Mon Jan 11 02:26:23 2016 +0200
@@ -111,6 +111,7 @@
 	int find_previous_word();
 	int find_next_word();
 	void reset_title();
+	void flush_input();
 };
 
 END_ZFC_NAMESPACE
\ No newline at end of file

mercurial