Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomly got an error message in the R console: Error in exists(mname) : first argument has length > 1 #76

Closed
hongyuanjia opened this issue Mar 8, 2024 · 1 comment

Comments

@hongyuanjia
Copy link
Contributor

I randomly got an error message in the R console: Error in exists(mname) : first argument has length > 1. After searching the codebase, I found this error was caused by nvim.getmethod() function. Changing exists(mname) to any(exists(mname)) should do the trick. But I am not familiar with nvimcom codebase and am not sure that mname should already be a single vector in the first place, and there are other places causing it to be a vector of length > 1.

R.nvim/nvimcom/R/misc.R

Lines 426 to 431 in 7c870c8

nvim.getmethod <- function(fname, objclass) {
mname <- paste0(fname, ".", objclass)
if (exists(mname) && is.function(get(mname)))
return(mname)
return(fname)
}

@hongyuanjia
Copy link
Contributor Author

I found R-nvim/cmp-r#6 just after I submitted this issue... Looks like it has been fixed in 7c870c8. Close now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant