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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Dec 14 15:21:14 UTC 2011


Revision: 4122
          http://rkward.svn.sourceforge.net/rkward/?rev=4122&view=rev
Author:   tfry
Date:     2011-12-14 15:21:13 +0000 (Wed, 14 Dec 2011)
Log Message:
-----------
Addition to r4080: Make up / down navigation work

Revision Links:
--------------
    http://rkward.svn.sourceforge.net/rkward/?rev=4080&view=rev

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/rkconsole.cpp
    trunk/rkward/rkward/syntax/r-syntax-test.R

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2011-12-14 11:47:38 UTC (rev 4121)
+++ trunk/rkward/ChangeLog	2011-12-14 15:21:13 UTC (rev 4122)
@@ -1,4 +1,4 @@
-- Allow some markup inside <text> elements in plugins, and auto-add breaks only for duplicate newlines.		TODO: document
+- Allow some markup inside <text> elements in plugins, and auto-add breaks only for duplicate newlines.
 - Reorganized t-test plugin, and add support for single sample t-tests			TODO: adjust test(s)
 - Fixed: Function argument hints for the second half of the parameter list would not be quoted, correctly
 - Improve keypress handling issues in the R Console, when the cursor or a selection is outside the editable range

Modified: trunk/rkward/rkward/rkconsole.cpp
===================================================================
--- trunk/rkward/rkward/rkconsole.cpp	2011-12-14 11:47:38 UTC (rev 4121)
+++ trunk/rkward/rkward/rkconsole.cpp	2011-12-14 15:21:13 UTC (rev 4122)
@@ -235,14 +235,25 @@
 	const int modifier_mask = Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier;
 	Qt::KeyboardModifiers modifier = e->modifiers () & modifier_mask;
 
-	if (key == Qt::Key_Up) {
-		commandsListUp (RKSettingsModuleConsole::shouldDoHistoryContextSensitive (modifier));
+	if ((key == Qt::Key_Up) || (key == Qt::Key_Down)) {
+		KTextEditor::CodeCompletionInterface *iface = qobject_cast<KTextEditor::CodeCompletionInterface*> (view);
+		if (iface && iface->isCompletionActive ()) {
+			if (key == Qt::Key_Up) triggerEditAction ("move_line_up");
+			else triggerEditAction ("move_line_down");
+			return true;
+		}
+
+		// showing completion list during history navigation is not a good idea, since it uses the same keys
+		bool auto_inv = (iface && iface->isAutomaticInvocationEnabled ());
+		if (iface) iface->setAutomaticInvocationEnabled (false);
+
+		if (key == Qt::Key_Up) commandsListUp (RKSettingsModuleConsole::shouldDoHistoryContextSensitive (modifier));
+		else commandsListDown (RKSettingsModuleConsole::shouldDoHistoryContextSensitive (modifier));
+
+		if (iface) iface->setAutomaticInvocationEnabled (auto_inv);
 		return true;
 	}
-	else if (key == Qt::Key_Down) {
-		commandsListDown (RKSettingsModuleConsole::shouldDoHistoryContextSensitive (modifier));
-		return true;
-	}
+
 	command_edited = true; // all other keys are considered as "editing" the current comand
 
 	if (key == Qt::Key_Home) {
@@ -460,7 +471,7 @@
 
 	if (e->type () == QEvent::KeyPress) {
 		QKeyEvent *k = (QKeyEvent *)e;
-		return handleKeyPress (k);
+		return (handleKeyPress (k));
 	} else if (e->type () == QEvent::MouseButtonPress) {
 		// we seem to need this, as the kateview will swallow the contextMenuEvent, otherwise
 		QMouseEvent *m = (QMouseEvent *)e;

Modified: trunk/rkward/rkward/syntax/r-syntax-test.R
===================================================================
--- trunk/rkward/rkward/syntax/r-syntax-test.R	2011-12-14 11:47:38 UTC (rev 4121)
+++ trunk/rkward/rkward/syntax/r-syntax-test.R	2011-12-14 15:21:13 UTC (rev 4122)
@@ -33,9 +33,10 @@
 	x <- * 1		# syntax error
 	x += 1 -= x1 *= x2	# syntax error
 	x =* 1 =/ x1 // x2	# syntax error
+	x +!= y +-= z +!/ 2	# syntax error
 	x =+ 1 =- x1		# These look misleading, but are legal
 	1 +-!-++--!!+ 1		# Crazy, but legal
-	x +!= y +-= z +!/ 2	# These are illegal, again
+	x <- ~1			# ERROR: Actually, this is legal, but it's marked up as an error
 	"%my 1st infix%" <- function (x, y) { x + y }		# legal infix
 	3 %my 1st infix% 4
 	"%my%infix%" <- function (x, y) { x + y }	# illegal infix

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