[Sciviews-commits] r349 - komodo/SciViews-K/content/js

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jan 24 14:51:10 CET 2011


Author: prezez
Date: 2011-01-24 14:51:10 +0100 (Mon, 24 Jan 2011)
New Revision: 349

Modified:
   komodo/SciViews-K/content/js/r.js
Log:
sv.r.run: bug fixed (now a whole is passed to R if no selection)

Modified: komodo/SciViews-K/content/js/r.js
===================================================================
--- komodo/SciViews-K/content/js/r.js	2011-01-24 13:48:34 UTC (rev 348)
+++ komodo/SciViews-K/content/js/r.js	2011-01-24 13:51:10 UTC (rev 349)
@@ -372,7 +372,7 @@
 		view.setFocus();
 
 		var text = sv.getTextRange("sel", true);
-		if(text == "") { // No selection
+		if(!text) { // No selection
 			var scimoz = view.scimoz;
 			var currentLine = scimoz.lineFromPosition(scimoz.currentPos);
 			var scimoz = view.scimoz;
@@ -381,9 +381,10 @@
 			while(currentLine < lineCount && !(text = oText.value.trim()))
 				scimoz.getLine(currentLine++, oText);
 			scimoz.gotoLine(currentLine);
+			text = oText.value;
 		}
 
-		if(text != "") 	return(sv.r.eval(text));
+		if(text) 	return(sv.r.eval(text));
 		return(false);
 
 	} catch(e) { return(e); }
@@ -1433,7 +1434,6 @@
 	sv.r.objects.clearPackageList();
 }
 
-
 // KB: I think these functions should be included only in a "developer's version",
 //     most users will not need them
 // Create a translation (.pot) file for a project



More information about the Sciviews-commits mailing list