Closed rcst closed 2 years ago
I can't replicate the issue because I don't use shiny, but nvimcom is no longer sending the jump command to Nvim-R when R is started while R_debug = 0
.
I installed shiny
. Could you post here an example of code that triggers the bug, please? I added browser()
to the beginning of the server()
from the RStudio example, but I didn't get the error that you reported.
I can get a similar error with these two R scripts:
ab'cd.R
:
nonsense <- function(x) {
y <- x + 5
z <- y - 5
z
}
testD.R
:
source("ab'cd.R")
debug(nonsense)
nonsense(9)
I fixed the bug when the file name of the function being sourced includes single quotes, as in my example above (ab'cd.R
).
Thanks @jalvesaq for your swift response!
I put together a reproducible example: https://github.com/rcst/nvimr.shiny.repex. While doing so, I found out, that the problem seems to be rooted in the length of absolute working directory.
Nonetheless, I put together an example that resembles the principle folder structure of what I'm working on.
On Debian, I do
cd ~
mkdir -p test/somelongerfoldername/subdirectory-with-dashes/yet.one.more.subdir.with.dots
cd test/somelongerfoldername/subdirectory-with-dashes/yet.one.more.subdir.with.dots
git clone https://github.com/rcst/nvimr.shiny.repex
cd nvimr.shiny.repex
nvim
I open file app.R
and start an R session by \rf
and execute shiny::runApp()
. This gives me the above error messages.
The call of browser()
happens in R/server.R
.
Can you reproduce it, too?
It might be fixed now...
It is! Thank you :)
First of, I'm using
Nvim-R
since about 8 years as my one and only way to interact with R. Thank you so much for this!I noticed this error:
(The path in
E115
is much longer.)while working on a Shiny App that I have put as a R package. Notably, I don't get this error, when simply calling a function containing
browser()
.The function that I'd like to debug via
browser()
is./R/server.R
(i.e, relative to the R-file from which I callshiny::runApp()
)My configuration in
~/.config/nvim/init.vim
: Most interestingly, I had setR_debug = 0
andR_dbg_jmp = 0
when I got this error, but that didn't help it go away. I get this error when using Nvim-R from any branch 'master', 'stable' and 'oldstable'.Any hint, what I can do to avoid it? It's quite annoying.