[rkward-cvs] SF.net SVN: rkward:[4212] trunk/rkward/packages/XiMpLe/R

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Thu Apr 26 09:20:58 UTC 2012


Revision: 4212
          http://rkward.svn.sourceforge.net/rkward/?rev=4212&view=rev
Author:   m-eik
Date:     2012-04-26 09:20:58 +0000 (Thu, 26 Apr 2012)
Log Message:
-----------
XiMpLe: trying to get nicer layout of text values, still a small problem in the regexp somewhere to be fixed

Modified Paths:
--------------
    trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R
    trunk/rkward/packages/XiMpLe/R/pasteXMLTag.R

Modified: trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R	2012-04-23 07:45:06 UTC (rev 4211)
+++ trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R	2012-04-26 09:20:58 UTC (rev 4212)
@@ -109,8 +109,11 @@
 ## function setMinIndent()
 # takes a string, determines the minimum number of grouped \t strings,
 # and adjusts it globally to the given level
-setMinIndent <- function(tag, level=1, indent.by="\t"){
+setMinIndent <- function(tag, level=1, indent.by="\t", shine=0){
 	currentMinIndent <- min(nchar(unlist(strsplit(tag, "[^\t]+"))))
+	if(shine > 0){
+		tag <- gsub("\n([^\t]+)", "\n\t\\1", tag, perl=TRUE)
+	} else {}
 	indentDiff <- currentMinIndent - level
 	# if currentMinIndent is greater than level, reduce indentation
 	if(indentDiff > 0){

Modified: trunk/rkward/packages/XiMpLe/R/pasteXMLTag.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/pasteXMLTag.R	2012-04-23 07:45:06 UTC (rev 4211)
+++ trunk/rkward/packages/XiMpLe/R/pasteXMLTag.R	2012-04-26 09:20:58 UTC (rev 4212)
@@ -51,7 +51,7 @@
 			if(!is.null(child)){
 				child <- trim(child)
 				if(isTRUE(tidy)){
-					child <- gsub("\n", new.cmmt, setMinIndent(child, level=level + 1, indent.by=indent.by))
+					child <- gsub("\n", new.cmmt, setMinIndent(child, level=level + 1, indent.by=indent.by, shine=shine))
 				}
 			} else {}
 			full.tag <- paste(new.indent, "<!-- ", new.attr, new.cmmt.indent,

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