randy3k/R-Box

Windows Menu Items not Working

Closed this issue · 14 comments

Apologies if this noob user/installation error.

I have installed latest version R-BOX and SendCode in SublimeText3 3126. I have configured SendCode choose program to RStudio. RStudio is open.

I can send code from Sublime to RStudio console via Ctrl-Enter, works great. However, if I try to do same using menu item for R-Box "Send Current Line/Selection..." instead of actually sending the code it seems to send 'v' and I get the message Error: object 'v' not found.

I get this same error message for most but not all other menu items under R-Box. The menu items that don't send a 'v' to RStudio don't appear to do anything.

I have tried uninstalling and reinstalling both R-Box and SendCode. I don't have SublimeREPL or any other Sendtext package installed (that I know of).

Ctrl-Enter is not bad but it would be great to actually be build packages, source files and so on.

Any ideas?

It is a know issue of Windows RStudio (I should have it documented). I am still actively looking for a solution.

Alternatively, you could use R GUI.

np. thanks. should have tried other settings for SendCode. Working perfectly with r console in ConEmu. Brilliant package for Sublime and R. Thank you.

The menu is now working with RStudio on Windows.

Randy, hi. I'm still getting the "Error: object 'v' not found" error from sublime R-Box to RStudio gui. Have uninstalled and reinstalled R-Box so assume I have latest version of R-Box. SendCode works well from same project with sublime, i.e. ctrl-enter sends to RStudio and executes without issue.

Did you also reinstall SendCode?

Good question; just reinstalled SendCode, restarted sublime. SendCode working fine; however, still getting R-Box error. No change. R-Box doesn't seem to work.

Actually I take that back. SendCode isn't working to send to RStudio now. Still works for R term in ConEmu.
I reinstalled both SendCode and R-box from scratch taking care to delete any R-Box and SendCode sublime config files in /Data/Packages/ and /Data/Packages/User dirs. The remove package of Package Control leaves a couple in place including /Data/Packages/User/R-Box/Main.sublime-menu and Data/Packages/User/SendCode.sublime-settings and Data/Packages/User/R-Box.sublime-settings.

I'm actually worse off now than before I think. SendCode was working great to RStudio until I tried updating R-Box and SendCode this afternoon.

Is there any info I can provide to help diagnose this?

Just to double check the versions not working for me are: SendCode:0.3.9 and R-Box:3.5.7

I also have these versions of SendCode and R-Box, they are working fine and sending code to RStudio.
How does it not work when you hit ctrl+enter and the R-Box menu?

The issue as shown in the sublime console is that SendCode is losing "sight" of RStudio. I rebooted, and opened single console in project; launched subl and then rstudio. worked fine. So it is user error again; my apologies.

Having said that it does seem a bit brittle in use.

For example, from a clean reboot:
(1) if I open a console in R proj, launch subl and rstudio; then SendCode/R-Box work fine.
(2) Leaving RStudio open from (1), launch a new console different project, open subl, open RSudio from this new console. SendCode/R-Box works but sends code to RStudio from (1). Maybe that is fine, only one RStudio process at any one time. I see from winauto.py that you find rstudio from windows handles titles so that makes sense but perhaps in session prior to reboot I had many handles titled rstudio and the order was getting messed up??
(3) Now if I close original RStudio, leave subl up from (1); open new console, launch new subl and rstudio. SendCode/R-Box sends to new RStudio but with "Error: object 'v' not found". Keep sending, after a few tries starts working.

Can't provide much more info than that, and no insight; sorry.

Anyway I think if I stick to single project open at anyone time; seems to work without any issue.

Thanks again for your help and great tool. Much faster than working with rstudio for editing and your R-Box gives best of both worlds all the nice bits of RStudio for debugging, viewing, etc. but still with super sublime editor.

Thanks for the detail report. It looks that things that I would expect. SendCode will only search for a RStudio window (it is actually the topmost RStudio window if I am right). If a previous session has just been closed, try switching focus to the remaining window several times, it should help SendCode to locate it. SendCode sends code to RStudio by pasting the clipboard. Sending a "v" letter means that the ctrl key didn't arrive there correctly. There is unfortunately not much I can do now..

Also, try not to release the ctrl key "immediately" (I mean really immediately) after ctrl+enter. Keep the ctrl key pressed for about half a second. It will also make sure the ctrl key will be sent correctly.

thank you for pointers; will do