Skip to content

Commit

Permalink
refactor(maps.lua, rmd.lua): rename send_R_chunk to send_current_chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
PMassicotte committed Feb 25, 2025
1 parent 00fef92 commit f03b8fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lua/r/maps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ local send = function(file_type)
end
if file_type == "rmd" or file_type == "quarto" then
create_maps("nvi", "RKnit", "kn", "<Cmd>lua require('r.run').knit()")
create_maps("ni", "RSendChunk", "cc", "<Cmd>lua require('r.rmd').send_R_chunk(false)")
create_maps("ni", "RDSendChunk", "cd", "<Cmd>lua require('r.rmd').send_R_chunk(true)")
create_maps("ni", "RSendChunk", "cc", "<Cmd>lua require('r.rmd').send_current_chunk(false)")
create_maps("ni", "RDSendChunk", "cd", "<Cmd>lua require('r.rmd').send_current_chunk(true)")
create_maps("n", "RNextRChunk", "gn", "<Cmd>lua require('r.rmd').next_chunk()")
create_maps("n", "RPreviousRChunk", "gN", "<Cmd>lua require('r.rmd').previous_chunk()")
end
Expand Down
3 changes: 1 addition & 2 deletions lua/r/rmd.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
local inform = require("r.log").inform
local config = require("r.config").get_config()
local send = require("r.send")
local get_lang = require("r.utils").get_lang
local uv = vim.uv
local chunk_key = nil
Expand Down Expand Up @@ -53,7 +52,7 @@ end

--- Sends the current R or Python code chunk to the R console for evaluation.
---@param m boolean If true, the cursor will move to the next code chunk after evaluation.
M.send_R_chunk = function(m)
M.send_current_chunk = function(m)
local bufnr = vim.api.nvim_get_current_buf()

local chunks = quarto.get_current_code_chunk(bufnr)
Expand Down

0 comments on commit f03b8fa

Please sign in to comment.