[rkward-cvs] SF.net SVN: rkward: [995] trunk/rkward/rkward/rkconsole.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Dec 5 15:29:35 UTC 2006


Revision: 995
          http://svn.sourceforge.net/rkward/?rev=995&view=rev
Author:   tfry
Date:     2006-12-05 07:29:35 -0800 (Tue, 05 Dec 2006)

Log Message:
-----------
Fixes to the last commits: Allow interrupting incomplete commands, again; fix new line addition in context of incomplete commands

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

Modified: trunk/rkward/rkward/rkconsole.cpp
===================================================================
--- trunk/rkward/rkward/rkconsole.cpp	2006-12-05 15:12:30 UTC (rev 994)
+++ trunk/rkward/rkward/rkconsole.cpp	2006-12-05 15:29:35 UTC (rev 995)
@@ -384,17 +384,18 @@
 void RKConsole::submitCommand () {
 	RK_TRACE (APP);
 
-	QString c = currentCommand ();
-	addCommandToHistory (c);
+	QString current_line = currentCommand ();
+	QString command = current_line;
+	addCommandToHistory (current_line);
 	
 	if (command_incomplete) {
-		c.prepend (incomplete_command + "\n");
+		command.prepend (incomplete_command + "\n");
 	}
 
-	if (!currentCommand ().isEmpty ()) {
-		current_command = new RCommand (c, RCommand::User | RCommand::Console, QString::null, this);
+	doc->insertText (doc->numLines () - 1, editInterface (doc)->lineLength (doc->numLines () -1), "\n");
+	if (!current_line.isEmpty ()) {
+		current_command = new RCommand (command, RCommand::User | RCommand::Console, QString::null, this);
 		RKGlobals::rInterface ()->issueCommand (current_command);
-		doc->insertText (doc->numLines () - 1, editInterface (doc)->lineLength (doc->numLines () -1), "\n");
 		interrupt_command_action->setEnabled (true);
 	} else {
 		tryNextInBatch ();
@@ -503,7 +504,7 @@
 	}
 
 	current_command = 0;
-	interrupt_command_action->setEnabled (false);
+	interrupt_command_action->setEnabled (isBusy ());
 }
 
 void RKConsole::paste () {
@@ -572,6 +573,7 @@
 	prefix = nprefix;
 	command_incomplete = false;
 	incomplete_command = QString::null;
+	doc->insertLine (doc->numLines (), "");
 
 	tryNextInBatch (true);
 }


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