Skip to content

Fix the command :RHelp#506

Merged
PMassicotte merged 2 commits intomainfrom
fix_RHelp
Feb 24, 2026
Merged

Fix the command :RHelp#506
PMassicotte merged 2 commits intomainfrom
fix_RHelp

Conversation

@jalvesaq
Copy link
Member

:RHelp now works with symbols such as %, ( and |

`:RHelp` now works with symbols such as `%`, `(` and `|`
@jalvesaq
Copy link
Member Author

How to try the new :RHelp command:

  • If you have autocompletion in the command line, just type :RHelp and anything more, such :RHelp a or :RHelp |.
  • If you don't have autocompletion enabled for the command line, press <c-d> to trigger the completion.

@PMassicotte
Copy link
Collaborator

Very good! Some comments coming.

local libs = vim.split(libs_in_rns, ",", { trimempty = true })
libs_in_rns = ""
rhelp_list = {}
M.rhelp_list = {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
M.rhelp_list = {}
rhelp_list = {}

I am not sure, but I think that subsequent calls to fill_Rhelp_list will keep appending duplicates to rhelp_list since it's never reset.

--- _ string The complete command line, including "Rhelp".
--- _ number Cursor position in complete command line.
M.list_objs = function(arg, _, _)
if arg == "" then return rhelp_list end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if arg == "" then return rhelp_list end
if libs_in_rns ~= "" then fill_Rhelp_list() end
if arg == "" then return rhelp_list end

Should this be the way around?

Copy link
Member Author

Choose a reason for hiding this comment

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

Line 310 resets libs_in_rns:

    libs_in_rns = ""

The logic is:

  • If there is a change in the list of loaded libraries, the string libs_in_rns is updated. That's all. Nothing else happens.
  • Only if the completion for :RHelp is triggered, all alias_ files from the libraries listed in libs_in_rns are read, rhelp_list is filled, and libs_in_rns is reset.

Perhaps, a better name for libs_in_rns could be new_libs_in_rns because when the variable is empty, it doesn't mean that there is no library; only that the list of libraries was already used to fill rhelp_list.

@PMassicotte
Copy link
Collaborator

Just few comments, you can check if that makes sense, but all good on my side. Good job.

@jalvesaq
Copy link
Member Author

I changed the name of the variable. I think the code is clearer now. Thank you for reviewing!

@PMassicotte PMassicotte merged commit b5e2b36 into main Feb 24, 2026
9 checks passed
@PMassicotte PMassicotte deleted the fix_RHelp branch February 24, 2026 12:07
@PMassicotte
Copy link
Collaborator

yay!

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