[rkward] rkward/rbackend: Fix ordering of command and output in console capturing/preview

Thomas Friedrichsmeier null at kde.org
Fri Sep 28 21:28:41 BST 2018


Git commit 066e46e4280efdc0c580aae92462fcae80278670 by Thomas Friedrichsmeier.
Committed on 28/09/2018 at 20:20.
Pushed by tfry into branch 'master'.

Fix ordering of command and output in console capturing/preview

M  +5    -5    rkward/rbackend/rkrbackend.cpp

https://commits.kde.org/rkward/066e46e4280efdc0c580aae92462fcae80278670

diff --git a/rkward/rbackend/rkrbackend.cpp b/rkward/rbackend/rkrbackend.cpp
index b35be9ef..4e879fd7 100644
--- a/rkward/rbackend/rkrbackend.cpp
+++ b/rkward/rbackend/rkrbackend.cpp
@@ -785,15 +785,15 @@ void RBusy (int busy) {
 	// R_ReplIteration calls R_Busy (1) after reading in code (if needed), successfully parsing it, and right before evaluating it.
 	if (busy) {
 		if (RKRBackend::repl_status.user_command_status == RKRBackend::RKReplStatus::UserCommandTransmitted) {
-			if (RKRBackend::this_pointer->current_command->type & RCommand::CCCommand) {
-				QByteArray chunk = RKRBackend::repl_status.user_command_buffer.mid (RKRBackend::repl_status.user_command_parsed_up_to, RKRBackend::repl_status.user_command_transmitted_up_to - RKRBackend::repl_status.user_command_parsed_up_to);
-				RKRBackend::this_pointer->printCommand (RKRBackend::toUtf8 (chunk));
-			}
 			if (RKRBackend::this_pointer->current_command->type & RCommand::CCOutput) {
-				// flush any previous output caputre and start a new one
+				// flush any previous output capture and start a new one
 				if (RKRBackend::repl_status.user_command_successful_up_to > 0) RKRBackend::this_pointer->printAndClearCapturedMessages (false);
 				RKRBackend::this_pointer->startOutputCapture ();
 			}
+			if (RKRBackend::this_pointer->current_command->type & RCommand::CCCommand) {
+				QByteArray chunk = RKRBackend::repl_status.user_command_buffer.mid (RKRBackend::repl_status.user_command_parsed_up_to, RKRBackend::repl_status.user_command_transmitted_up_to - RKRBackend::repl_status.user_command_parsed_up_to);
+				RKRBackend::this_pointer->printCommand (RKRBackend::toUtf8 (chunk));
+			}
 			RKRBackend::repl_status.user_command_parsed_up_to = RKRBackend::repl_status.user_command_transmitted_up_to;
 			RKRBackend::repl_status.user_command_status = RKRBackend::RKReplStatus::UserCommandRunning;
 		}



More information about the rkward-tracker mailing list