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

Display :RMapsDesc and :RConfigShow in a split buffer instead of as an nvim_echo() statement #297

Merged
merged 5 commits into from
Dec 27, 2024

Conversation

kkanden
Copy link
Contributor

@kkanden kkanden commented Dec 24, 2024

This change will make outputs of these two commands display in a separate buffer, which will allow for easier navigation and searching for specific commands, mappings and config options. This will also mimic the behavior of :h making it less dizzying.

@jalvesaq
Copy link
Member

Thanks for your contribution! Please, create a symbolic link to scripts/pre-commit as explained in CONTRIBUTING.md and run stylua:

cd /path_to/R.nvim
stylua lua

@jalvesaq
Copy link
Member

Maybe we could add this to the buffers (as we do for R documentation):

    vim.api.nvim_buf_set_keymap(0, "n", "q", ":q<CR>", { noremap = true, silent = true })

Perhaps we shouldn't use a buffer when an argument is passed to :RConfigShow because a single value is displayed. Example:

:RConfigShow compldir

Although it might be a table:

:RConfigShow compl_data

What do you think about these suggestions?

@kkanden
Copy link
Contributor Author

kkanden commented Dec 26, 2024

I think those are good ideas. I forgot that you could pass na argument to :RConfigShow. Maybe if an argument is passed, the value of that option could just be displayed using nvim_echo() as it is now, and if no argument is passed, only then display it in a buffer?

@jalvesaq
Copy link
Member

Maybe if an argument is passed, the value of that option could just be displayed using nvim_echo() as it is now, and if no argument is passed, only then display it in a buffer?

Yes, I agree.

@kkanden
Copy link
Contributor Author

kkanden commented Dec 27, 2024

I've implemented the suggestions. I have also added highlighting to the keywords in :RConfigShow for better looks :)

@jalvesaq
Copy link
Member

Thank you! It was a good improvement to the two commands!

@jalvesaq jalvesaq merged commit 4d70f1b into R-nvim:main Dec 27, 2024
@kkanden kkanden deleted the command_display branch December 27, 2024 11:42
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