[rkward-cvs] SF.net SVN: rkward:[2740] trunk/rkward/rkward/scriptbackends/common.js

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Feb 11 21:15:23 UTC 2010


Revision: 2740
          http://rkward.svn.sourceforge.net/rkward/?rev=2740&view=rev
Author:   tfry
Date:     2010-02-11 21:15:16 +0000 (Thu, 11 Feb 2010)

Log Message:
-----------
Small correction to indented printing

Modified Paths:
--------------
    trunk/rkward/rkward/scriptbackends/common.js

Modified: trunk/rkward/rkward/scriptbackends/common.js
===================================================================
--- trunk/rkward/rkward/scriptbackends/common.js	2010-02-11 20:52:23 UTC (rev 2739)
+++ trunk/rkward/rkward/scriptbackends/common.js	2010-02-11 21:15:16 UTC (rev 2740)
@@ -4,11 +4,13 @@
 }
 
 function printIndented (indentation, lines) {
-	echo (indentation + lines.replace (/\n/g, "\n" + indentation));
+	/** More complex than may seem necessary at first glance. The point is that the
+	final linebreak in the input should *not* be replaced by linebreak + indentation. */
+	echo (indentation + lines.replace (/\n(.)/g, "\n" + indentation + "$1"));
 }
 
 function noquote (text) {
-	ret = new String (text);
+	var ret = new String (text);
 	ret.noquote = 1;
 	return (ret);
 }


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