Comments (17)
It's fixed now.
from r.nvim.
Thanks for reporting the issue and all the feedback!
from r.nvim.
This plugin doesn't auto-format when saving. As before, you have to manually select some lines and do :RFormat
.
I will look at the other two bugs.
from r.nvim.
The csv_app
options should be fixed now.
I can't replicate the Object Browser bug, but if you still see the problem, I can add a "redraw" to see if it is fixed.
from r.nvim.
The csv_app options should be fixed now.
Yes, it worked. Thank you. However, I'm trying to make it more interactive since it accepts a function like this:
csv_app = function(tsv_file)
local app = vim.fn.input("Enter the application name: ")
if app == "" then
app = "tad"
end
vim.cmd("tabnew | terminal " .. app .. " " .. tsv_file)
vim.cmd("startinsert")
end,
But this didn't work. I'm not sure if this is how we should set it up, but the app complains that the file tsv doesn't exist, even though the app gets the name correctly.
I can't replicate the Object Browser bug, but if you still see the problem, I can add a "redraw" to see if it is fixed.
I still have the issue, but that's okay. It's just a bit inconvenient; I can get used to it.
from r.nvim.
Your function worked for me, but, while converting VimScript to Lua, in some cases, I had to call more interactive functions through vim.schedule
. So, you could try:
csv_app = function(tsv_file)
vim.schedule(function ()
vim.ui.input({ prompt = "Enter the application name: "}, function (input)
if input == "" then
input = "vd"
end
vim.cmd("tabnew | terminal " .. input .. " " .. tsv_file)
vim.cmd("startinsert")
end)
end)
end,
from r.nvim.
- The
rbrowser
(<localleader>ro
) doesn't refresh when I open it until I perform some assignment (like if I was working and open it, it shows nothing until I do some assignment).
Could you try this:
hook = {
after_ob_open = function ()
vim.cmd("redraw")
end,
},
If it solves the issue, I will add vim.cmd("redraw")
to lua/r/browser.lua
.
from r.nvim.
Your function worked for me, but, while converting VimScript to Lua, in some cases, I had to call more interactive functions through vim.schedule.
Thank you for your feedback. Actually, both of them didn't work for me, and they produced the same result on Neovim stable 0.9.5 and nightly. I initially avoided using vim.ui.input
because of its async nature, but even with vim.schedule
, I had the same experience.
If it solves the issue, I will add
vim.cmd("redraw")
tolua/r/browser.lua
.
Unfortunately, didn't solve the issue for me. I even tried calling redraw
on rbrowser
manually, but nothing happened until I performed a different assignment, after which it refreshed.
I'll try to create a minimal repro today and update here. It might be a configuration issue, but I'm not sure yet.
from r.nvim.
I'm sorry! I was using a very small data.frame (only two lines) and didn't note that vd
created an empty sheet. In fact, the data.frame wasn't being saved for the hook function. It should work now.
from r.nvim.
I've also replaced some VimScript functions with Lua ones in browser.lua, but I don't believe that this will make any difference.
from r.nvim.
In fact, the data.frame wasn't being saved for the hook function. It should work now.
It works like a charm right now, thank you.
I've also replaced some VimScript functions with Lua ones in browser.lua, but I don't believe that this will make any difference.
Unfortunately, the issue persists. Even after reopening the rbrowser and applying assignments, nothing appears. Here's a minimal reproducible code:
Steps to reproduce:
- Create a minimal.lua file as described below.
- Run 'nvim --clean -u minimal.lua'.
- Open any R file, perform some assignments, then use '\ro'.
- Repeat the process of doing assignments and then again '\ro' to hide and then
\ro
to show, and notice that nothing appears in this session again.
minimal.lua
:
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{
"jalvesaq/tmp-R-nvim",
lazy = false,
config = function()
local opts = {
csv_app = function(tsv_file)
vim.schedule(function()
vim.ui.input({ prompt = "Enter the application name: " }, function(input)
if input == "" then
input = "vd"
end
vim.cmd("tabnew | terminal " .. input .. " " .. tsv_file)
vim.cmd("startinsert")
end)
end)
end,
R_args = { "--quiet", "--no-save" },
hook = {
after_ob_open = function()
vim.cmd("redraw")
end,
after_config = function()
if vim.o.syntax ~= "rbrowser" then
vim.api.nvim_buf_set_keymap(0, "n", "<Enter>", "<Plug>RDSendLine", {})
vim.api.nvim_buf_set_keymap(0, "v", "<Enter>", "<Plug>RSendSelection", {})
end
end,
},
}
require("r").setup(opts)
end,
},
}, {})
here is a video for minimal rero, describing the issue:
Kapture.2024-02-20.at.21.06.29.mp4
from r.nvim.
I figured out what was the problem. It was updating immediately only when cmp-r
was installed. Should be fixed now.
from r.nvim.
thank you for the hard work. yes it worked and objects will show up in the first time you open it.
However, have you attempted to close and reopen it? After doing so, it fails to display anything, regardless of the actions taken thereafter.
from r.nvim.
When closing it, I believe there's a message in the echo area. I've now noticed this. It's in the job.lua:58
file.
from r.nvim.
It works perfectly now, thank you. I really appreciated!
from r.nvim.
Note: the immediate update will not work on Windows.
from r.nvim.
Just my 2 cents, tidy-viewer is also working great
https://github.com/alexhallam/tv
from r.nvim.
Related Issues (20)
- Breaking changes introduced by the latest version of treesitter? HOT 29
- Issue from LSP? HOT 3
- Upcoming R version might break nvimcom HOT 7
- nvimcom fails to compile since 4f28bfd HOT 3
- Has function of `<Leader>l` and `<Leader>d` been changed? HOT 10
- In tmux RDSendLine does not work when opening a second buffer HOT 3
- Running R in a ToggleTerm HOT 4
- .Rnw does not highlight latex syntax until I do :e HOT 3
- renv is ignored when using external_term HOT 10
- R code lines incorrectly identified HOT 16
- Rpipe sends keymap string instead of pipe operator `|>` HOT 9
- Syntax highlighting is not enabled in the help window HOT 4
- Better capture nodes for printing the object under the cursor HOT 6
- omnifunc not set HOT 3
- What is the proper place to custom map/keybindings? HOT 3
- nvimcom:::source.and.clean inconsistently needs plot() HOT 7
- Commands in R markdown (.rmd) documents not sent when nested in HTML tags HOT 9
- Segmentation Fault in nvimcom When Opening and Closing R Files Without Starting R HOT 8
- Add pyodide and webr extensions to qmd HOT 4
- Server crashes when trying to use `spData` package HOT 4
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 r.nvim.