-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
runtime(ftplugin): don't create new user commands for keywordprg #18602
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
Conversation
Problems
- Creating a new user command for 'keywordprg' makes it visible to users
in 'wildmenu', even though that command is not intended to be used directly by users.
Solution:
- Use `let &l:keywordprg = ':call '..expand('<SID>')..'KeywordFunc()"'` pattern instead
| return system('bash -c "help ' . keyword . ' 2>/dev/null"') | ||
| endif | ||
| endfunction | ||
| let &l:keywordprg=':call ' .. expand('<SID>') .. 'KeywordPrg() "' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some inconsistent use of concatenate operator . vs ...
Also, the trailing " seems wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trailing " is intended, to avoid Vim processing args added to the comment after that, otherwise it would cause syntax error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like a big hack. When would such a thing happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so this is because of the default K behaviour? In that case, I'd rather not use such a hack and keep the existing behaviour of using a custom :com instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this way is at least better for GoKeywordPrg, because even before this PR, that command doesn't handle the argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work fine for me.
Co-authored-by: Christian Brabandt <[email protected]>
55c3aa1 to
e26b3ce
Compare
|
Why does "test_popupwin" fail? |
|
I am closing this. |
Problems
Solution:
let &l:keywordprg = ':call '..expand('<SID>')..'KeywordFunc()"'pattern instead