Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
- Require nvim-0.8.0 to call the function `nvim_set_option_value()`
  (see #784 (comment)).
- Only alert about R.nvim existence if $MYVIMRC is `init.lua`.
- Improve arrow curve in SVG image.
  • Loading branch information
jalvesaq committed Mar 12, 2024
1 parent 167ccf6 commit 4f589ba
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 32 deletions.
2 changes: 1 addition & 1 deletion R/functions.vim
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function FunHiOtherBf()
for bId in nvim_list_bufs()
let bsyn = nvim_buf_get_option(bId, "syntax")
if bsyn == 'r' || bsyn == 'quarto' || bsyn == 'rhelp' || bsyn == 'rmd' || bsyn == 'rnoweb' || bsyn == 'rrst'
if has("nvim-0.7.0")
if has("nvim-0.8.0")
call nvim_set_option_value("syntax", bsyn, {'buf': bId})
else
call nvim_buf_set_option(bId, "syntax", bsyn)
Expand Down
2 changes: 1 addition & 1 deletion R/start_nrs.vim
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,6 @@ if exists('g:R_hi_fun_globenv')
endif

" 2024-03-03
if has("nvim-0.10") && ((rand(srand()) % 16 ) == 7)
if has("nvim-0.10") && $MYVIMRC =~ "init.lua" && ((rand(srand()) % 7 ) == 4)
call RWarningMsg('Nvim-R was superseded by https://github.com/R-nvim/R.nvim')
endif
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ note:
The diagram below shows how the communication between Vim/Neovim and R works.
![Neovim-R communication](https://raw.githubusercontent.com/jalvesaq/Nvim-R/master/nvimrcom.svg "Neovim-R communication")

The black arrow represents all commands that you trigger in the editor and
The black arrows represent all commands that you trigger in the editor and
that you can see being pasted into R Console.
There are three different ways of sending the commands to R Console:

Expand Down
67 changes: 38 additions & 29 deletions nvimrcom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4f589ba

Please sign in to comment.