Comments (18)
Many thanks for your help, Jakson. I totally agree with your conclusion, and will bring this to the MacVim developer.
from nvim-r.
Thanks!
from nvim-r.
Unless you have built MacVim yourself, it should not work. The last MacVim release includes Vim patches up to 1553, and Nvim-R requires 1579. However, you should have seen this error message:
Nvim-R requires either Neovim >= 0.1.2 or Vim >= 7.4.1579.
If using Vim, both +channel and +job features must be enabled.
from nvim-r.
Hi Jakson,
Thanks for the prompt reply.
I am using MacVim unstable 7.4.1589 (installed using brew install -HEAD macvim), and both +channel and +job features are enabled (I checked using :version command inside MacVim). I still get the above problem.
-Song
from nvim-r.
Unfortunately, in this case, I don't know what might be wrong because I don't have access to a Mac OS X.
from nvim-r.
I tried Vim unstable + Nvim-R on my Debian stable. The gui vim (gvim) can send R commands without any problem. It seems that the problem is specific to gui MacVim. Hope someone with a Mac OS can figure it out. I will try to solve the problem as well.
from nvim-r.
Hi Jakson,
Just more information about the same problem. I know that you do not have access to Mac OS, but this information may ring a bell to you or someone else.
(1) With Gui MacVim, after I call a R console using ",rf", I cannot send other commands like ",aa", ",rq" etc. And I also cannot use other plugins that use keyboard shortcuts. For example, I have vim-surround, and typing "yss)" is supposed to put () around a line, but now it does not work after I invoked R. I also have nerdcommenter, and typing ",cc" is supposed to comment the current line; it does not work either now.
(2) I have set the mapping "vmap RDSendSelection", and "nmap RDSendLine" in my .vimrc. Now the magic is that the space bar still works for sending commands to R, and if I send a command using space bar just once, everything goes back to normal: ",aa" works now, and all other plugins work again. This is a mystery.
I think it might be a bug in nvimcom.
Hopefully the above phenomena provide you with some useful information.
Cheers,
-Song
from nvim-r.
It looks like the channel is waiting for input, and somewhat blocking input from the keyboard. When the first command in the R Console is executed successfully, nvimcom sends a message to Vim telling Vim to update the syntax highlight of functions. You can see this if you put in your .Rprofile:
options(nvimcom.verbose = 4)
Then, after starting R, type in the R terminal any valid command, such as the number 1
. The output here is:
> 1
[1] 1
nvimcom_nvimclient(FillRLibList()): '10101' (10101)
from nvim-r.
I tried that. With gui MacVim, I got
nvimcom 0.9.14 loaded
NVIMR_TMPDIR = /var/folders/mh/v1yyk3sx4nn831fqs_wsynch0000gn/T/Nvim-R-scai
NVIMR_ID = LffBOpXy6Mv8U0R5qZSg
nvimcom port: 10001
nvimcom_eval_expr: 'nvimcom:::nvim.buildomnils('nvimcom')'
nvimcom R: No need to build omnils: nvimcom 0.9-14
... ...
nvimcom_eval_expr: 'nvimcom:::nvim.buildomnils('base')'
nvimcom R: No need to build omnils: base 3.2.4
then it is stuck there. And Vim is using 160% of CPU. If I type 1 in R console, it gives me
1
[1] 1
I think this is not the supposed behaviour.
When using terminal MacVim I got
... ...
nvimcom_eval_expr: 'nvimcom:::nvim.buildomnils('base')'
nvimcom R: No need to build omnils: base 3.2.4
nvimcom Received: [1] 10101
If I type 1 in R console, I get
1
[1] 1
nvimcom_nvimclient(FillRLibList()): '10101' (10101)
This looks like the right behaviour.
from nvim-r.
The terminal MacVim seems to be OK. What is missing in gui MacVim is
nvimcom Received: [1] 10101
which means that the nclientserver
(started by Nvim-R with job_start()
function) is running, and Nvim-R has sent its port number to nvimcom. The message FillRLibList()
is sent from nvimcom to Nvim-R only when nvimcom knows the clientserver
port.
That is, it looks like the +channel and +job features are not working properly in the gui MacVim.
What is the output of
:echo rplugin_jobs
after R is started (in both terminal and gui MacVim)?
from nvim-r.
The output in terminal MacVim is
{'R': 'no', 'Terminal emulator': channel 0 closed, 'ClientServer': channel 1 open}
The output in gui MacVim is
{'R': 'no', 'Terminal emulator': channel 0 open, 'ClientServer': channel 1 open}
from nvim-r.
The clientserver
application is running in both. The problem seems to be the Terminal emulator job. What happens if you put this in your vimrc?:
let R_silent_term = 1
This will switch to the old code that was already used in the Vim-R-plugin, but which I also don't know if works with gui MacVim.
from nvim-r.
If I do that, the problem persists and the output of :echo rplugin_jobs is
{'R': 'no', 'Terminal emulator': 'no', 'ClientServer': channel 0 open}
from nvim-r.
Conclusion: the problem is in the nclientserver
running as a job. Since the code works on Linux and even on terminal MacVim, I guess the bug is some kind of undue interaction between the +channel feature and gui MacVim. Perhaps you should report the bug to the MacVim developer.
from nvim-r.
It seems the bugs in MacVim were fixed:
macvim-dev/macvim#281
macvim-dev/macvim#283
Can anyone check if Nvim-R is working on MacVim now, please?
from nvim-r.
I confirm that Nvim-R is working on MacVim 7.4.1831. However I sometimes (not always) get the following error message after I send some code to R:
"E119: Not enough arguments for function: ROnJobExit "
Cheers,
-Song
from nvim-r.
I believe it is fixed now: 3c76c67
from nvim-r.
Yes, Jakson. It fixes the issue. Many thanks.
If you need someone to test on a Mac in the future, I would be glad to help
from nvim-r.
Related Issues (20)
- Object Browser display issue for a certain object HOT 12
- Connection with nvimrserver was lost HOT 2
- Cannot install nvimcom for R on windows HOT 1
- RMarkdown to PDF opens a new window every time. HOT 9
- Error detected while processing function ROnJobStdout HOT 23
- Implementing default location for the R Terminal HOT 1
- Manually killing pdf viewer prevents vim from opening it again HOT 3
- Regression: prompt with ANSI escape sequences HOT 6
- Autocomplete with non-loaded library HOT 5
- Nvim-R requires Tmux >=3.0 but 3.3a version installed HOT 6
- SendLineToR fails with error "unexpected numeric constant" HOT 3
- Fresh LunarVim install with Nvim-R exits with SIGABRT HOT 7
- `R_app`, `R_cmd` options are not respected in LunarVim HOT 7
- Large objects don't seem to be able to fill secondary lists with completions (<C-n><C-o>) HOT 5
- Autocomplete for function parameters stops working when R opens HOT 2
- `RQuarto()` should escape Windows path seperator before sending to R HOT 2
- Unknown function: nvim_set_option_value HOT 2
- No new features in Nvim-R
- Is it possible to change the indentation behavior after parenthesis to be the same as curly brace? HOT 3
- How to use Python in Quarto with Nvim-R HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-r.