[Sciviews-commits] r72 - pkg/svTools/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Nov 5 14:28:42 CET 2008
Author: romain
Date: 2008-11-05 14:28:42 +0100 (Wed, 05 Nov 2008)
New Revision: 72
Modified:
pkg/svTools/R/completion.R
Log:
handle NULL return from svMisc:::CompletePlus
Modified: pkg/svTools/R/completion.R
===================================================================
--- pkg/svTools/R/completion.R 2008-11-04 10:34:45 UTC (rev 71)
+++ pkg/svTools/R/completion.R 2008-11-05 13:28:42 UTC (rev 72)
@@ -1,13 +1,16 @@
CompletePlusWrap <- function( ... ){
out <- CompletePlus( ..., minlength = 1 )
- types <- rep( "function" , nrow(out ) )
- completions <- out[,1]
- types[ completions %~% "= *$" ] <- "argument"
- types[ completions %~% ":: *$" ] <- "package"
- # arguments first, then functions, then packages
- out <- cbind( out, types ) [ order(types),, drop = FALSE ]
-
+ if( is.null(out) ){
+ out <- matrix( "", nc = 4, nr = 0 )
+ }else{
+ types <- rep( "function" , nrow(out ) )
+ completions <- out[,1]
+ types[ completions %~% "= *$" ] <- "argument"
+ types[ completions %~% ":: *$" ] <- "package"
+ # arguments first, then functions, then packages
+ out <- cbind( out, types ) [ order(types),, drop = FALSE ]
+ }
token <- utils:::.guessTokenFromLine( )
fun <- utils:::inFunction()
if(length(fun) && !is.na(fun)){
More information about the Sciviews-commits
mailing list