heraldofsolace / VimHelpBot

VimHelpBot is a bot that replies to r/vim and r/neovim comments with link to Vim Help page
GNU General Public License v3.0
46 stars 2 forks source link

Find tags with trailing punctuation #39

Closed jakergrossman closed 3 years ago

jakergrossman commented 3 years ago

This commit attempts to better match tags when used in sentences with punctuation. If a whitespace-style match is not found, but the last character is one of the common punctuation characters in text (",", ".", ";", ":"), the bot will strip the trailing punctuation to try again.

I figured that this would catch the following common cases:

You should check out :h 'formatlistpat'.

These could be helpful: :h :exec, :h :normal, and :h :nnoremap.

From :h 'scrolloff': blah

This even works when you try something you really shouldn't, like:

You can use :h quote..

This would break here:

You can use :h quote.

finding :h quote. instead of :h quote, but in a case like that you really should use backticks, anyways.

If you can think of additional common cases, let me know!

Resolves #11.

heraldofsolace commented 3 years ago

Looks good to me. Thanks.