Closed bassamsdata closed 7 months ago
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.
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.
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.
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,
- 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
.
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.
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.
I've also replaced some VimScript functions with Lua ones in browser.lua, but I don't believe that this will make any difference.
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:
\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:
https://github.com/jalvesaq/tmp-R-Nvim/assets/105807570/5b474aad-a7f6-4e8a-9574-c7ec51d31d8c
I figured out what was the problem. It was updating immediately only when cmp-r
was installed. Should be fixed now.
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.
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.
It's fixed now.
It works perfectly now, thank you. I really appreciated!
Thanks for reporting the issue and all the feedback!
Note: the immediate update will not work on Windows.
Just my 2 cents, tidy-viewer is also working great
Congratulations on the new plugin refactoring! and thank you for the hard work. After testing it, I'd like to highlight a few points:
However, I noticed a few things:
=
instead of<-
because I work with Python a lot, and I want to keep things consistent, so is there a way?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).csv_app
feature doesn't seem to work anymore. I had it set asvim.g.csv_app = "terminal: vd"
, but now it doesn't work. I tried adding\rv
output in the echo area:to the plugin config, but it complained about it. So, I'm not sure how this will work, even though I saw it in the source code.
rbrowser
, to save some more space on the left, there's no need for thesigncolumn
orfoldcolumn
options, and I was going to make a pr to add these 2 options, but then I decided to know if those was intentional.Overall, great job on the plugin!
Thank you