R-nvim / R.nvim

Neovim plugin to edit R files
GNU General Public License v3.0
129 stars 15 forks source link

Fix some functions #63

Closed she3o closed 4 months ago

jalvesaq commented 4 months ago

I missed the nvim_buf_line_count()... Thanks for finding it! Since now get_last_line_num() in r.utils is a single line, we can delete it and call vim.api.nvim_buf_line_count(0) directly instead.

The motion function is not being called. I found that calling a Lua function with v:lua. must use single quotes without parentheses (see :h v:lua-call). Then, in lua/r/maps.lua, the mapping should change to:

    create_maps("ni.", "RSendMotion",         "m",        "<Cmd>set opfunc=v:lua.require'r.send'.motion<CR>g@")

But even after this, the motion doesn't seem to be correctly recognized.