Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behave as documented #46

Merged
merged 1 commit into from
Feb 23, 2024
Merged

Behave as documented #46

merged 1 commit into from
Feb 23, 2024

Conversation

jalvesaq
Copy link
Member

  • Send marked block: don't include line of second mark.
  • Open html according to options (0, 1, 2).
  • Go to next/previous chunk v:count1 times.

- Send marked block: don't include line of second mark.
- Open html according to options (0, 1, 2).
- Go to next/previous chunk v:count1 times.
@jalvesaq
Copy link
Member Author

I revised R.nvim documentation and noted three features that were not implemented as they were in Nvim-R:

  1. When sending a marked block to R, the line of the second mark should not be included. It was defined this way in Nvim-R to allow users to mark various lines in an R script and send one block after the other. If both, the first and the second marks had their lines included, each marked line would be sent twice. I still would like to find an efficient way of replacing vim.fn.line("$") for which lua_ls warns that the result might nil.

  2. Opening an HTML was not being like a PDF, although the options are the same (0: don't open; 1: open, but don't focus; 2: open and focus). I fixed the implementation and added a note to the documentation explaining that in many cases R.nvim will not be able to do what is expected. I moved the function that focuses the window from pdf/init.lua to utils.lua because now it's also used to focus a browser window.

  3. When going to a previous/next chunk of code (Rmd, Quarto, or Rnoweb), the variable v:count must be considered. For example, 3\gn means "jump to the third chunk below". This happened automatically in VimScript, but I had to code it manually in Lua.

@jalvesaq
Copy link
Member Author

I believe this pull request is ready to be merged, but, of course, it would be better if someone could review it.

Copy link
Collaborator

@PMassicotte PMassicotte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested the branch and everything seems to work on my side.

@jalvesaq
Copy link
Member Author

Thank you! I will merge it.

@jalvesaq jalvesaq merged commit caaf19f into R-nvim:main Feb 23, 2024
1 check passed
@jalvesaq jalvesaq deleted the follow_doc branch February 27, 2024 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants