[TxMt] R bundle: getSig.r function of 'Insert Command Template' problem

Hans-Joerg Bibiko bibiko at eva.mpg.de
Tue Dec 19 11:51:50 UTC 2006


Hi,

I just found a very tiny bug within the R function getSig.r of that  
bundle.
If you type 'plot.lm' and invoke that command to get the template it  
gives you a weird output because within the formals you find an item  
'caption', and within this item there is a '\n'. The ruby pop down  
menu, of course, interprets a '\n' as a new line.

To avoid this I would include within the getSig.r at line 12 this:

10:		if (is.symbol(f[[arg]]) && f[[arg]] == "") arg else list(arg, f 
[[arg]])
11:	),
12:	function (arg, escape=function(x) ifelse(snippet, {gsub("([\\ 
$`}])", "\\\\\\1", x);gsub("\n", "", x)}, x))
13:		if (is.list(arg))

i.e. I add a  gsub in the 'escape' function to delete each '\n'

I don't know whether this will be good. The case is very rarely.

Comments?

Best,
-Hans



More information about the textmate mailing list