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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jul 9 09:18:50 CEST 2008


Author: romain
Date: 2008-07-09 09:18:50 +0200 (Wed, 09 Jul 2008)
New Revision: 48

Modified:
   komodo/SciViews-K/content/js/console.js
Log:
minor change to cope with the types argument in CompletePlus

Modified: komodo/SciViews-K/content/js/console.js
===================================================================
--- komodo/SciViews-K/content/js/console.js	2008-07-09 07:17:58 UTC (rev 47)
+++ komodo/SciViews-K/content/js/console.js	2008-07-09 07:18:50 UTC (rev 48)
@@ -126,11 +126,11 @@
 }
 
 sv.r.console.getCompletionTypes = function(){
-  var out = "" ;
+  var out = [] ;
   var types = [ "arguments", "packages", "functions" ] ;
   for( var i=0; i<types.length; i++){
     if( sv.prefs.getString( "sciviews.console.completion.setting." + types[i] ) == "true"){
-      out += types[i] + "," ;
+      out[out.length] = types[i] ;
     }
   }
   return(out);
@@ -142,7 +142,13 @@
   sv.r.console._completionCounter++ ;
   var types = sv.r.console.getCompletionTypes() ;
   if( types != ""){
-    cmd = "CompletePlus('" + sv.r.console.getConsoleContent().replace(/'/g, "\\'")  + "' , simplify = TRUE, types= '"+ types +"')" ;
+    var types_vector = 'c("' + types[0] ;
+    for( var i=1; i<types.length; i++){
+      types_vector += '", "' + types[i] ;
+    }
+    types_vector += '") ' ;
+    cmd = "CompletePlus('" + sv.r.console.getConsoleContent().replace(/'/g, "\\'")  +
+      "' , simplify = TRUE, types= " + types_vector +  " )" ;
     sv.r.evalCallback(cmd, sv.r.console.complete_cb, sv.r.console._completionCounter );
   }
 }
@@ -205,7 +211,7 @@
     var tab, comp;
     for(var i=0; i<completions.length; i++){
       if(completions[i] != ""){
-        tab = completions[i].split(",");
+        tab = completions[i].split("\t");
         comp = tab[0];
         if( argRx.test(comp) ){
           argCompletions[ argCompletions.length] = tab ;



More information about the Sciviews-commits mailing list