[rkward-cvs] SF.net SVN: rkward:[3212] trunk/rkward/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Nov 23 17:14:15 UTC 2010


Revision: 3212
          http://rkward.svn.sourceforge.net/rkward/?rev=3212&view=rev
Author:   tfry
Date:     2010-11-23 17:14:15 +0000 (Tue, 23 Nov 2010)

Log Message:
-----------
Fix off by one issue in interleaving code and output

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rkrbackend.cpp
    trunk/rkward/rkward/rkconsole.cpp

Modified: trunk/rkward/rkward/rbackend/rkrbackend.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rkrbackend.cpp	2010-11-23 17:13:15 UTC (rev 3211)
+++ trunk/rkward/rkward/rbackend/rkrbackend.cpp	2010-11-23 17:14:15 UTC (rev 3212)
@@ -182,7 +182,7 @@
 	}
 	buf[++pos] = '\0';
 
-	if (reached_newline) {
+	if (reached_newline || reached_eof) {
 		// Making this request synchronous is a bit painful. However, without this, it's extremely difficult to get correct interleaving of output and command lines
 		RBackendRequest req (true, RBackendRequest::CommandLineIn);
 		req.params["commandid"] = RKRBackend::this_pointer->current_command->id;

Modified: trunk/rkward/rkward/rkconsole.cpp
===================================================================
--- trunk/rkward/rkward/rkconsole.cpp	2010-11-23 17:13:15 UTC (rev 3211)
+++ trunk/rkward/rkward/rkconsole.cpp	2010-11-23 17:14:15 UTC (rev 3212)
@@ -565,7 +565,7 @@
 	setCurrentEditingLine (command.mid (current_command_displayed_up_to, command.indexOf ('\n', current_command_displayed_up_to) - current_command_displayed_up_to));
 	current_command_displayed_up_to += currentEditingLine ().length ();
 
-	skip_command_display_lines = incomplete_command.count ('\n');	// incomplete command has already been shown.
+	skip_command_display_lines = incomplete_command.count ('\n') + 1;	// incomplete command, and first line have already been shown.
 
 	if (!command.isEmpty ()) {
 		doc->insertLine (doc->lines (), QString ());


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list