Add findcommand() function#7777
Add findcommand() function#7777arp242 wants to merge 2 commits intovim:masterfrom arp242:findcommand
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7777 +/- ##
==========================================
+ Coverage 88.70% 88.92% +0.22%
==========================================
Files 148 144 -4
Lines 164696 162819 -1877
==========================================
- Hits 146088 144786 -1302
+ Misses 18608 18033 -575
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
Hm, the Windows AppVeyor build fails with: For the line: Not entirely sure why that should fail, and why it fails only on Windows 🤔 I don't have a Windows machine to test, so if anyone has any hints then that would be appreciated. |
can you put this at the beginning of the function please? |
|
MSVC 2010 doesn't support to declare a variable in the middle of the block. |
Right now there is no way to know which shortcut commands refer to which commands. This adds findcommand() to solve that. Context: I made a little VimScript to show the help for the command you typed: pressing <F1> while you typed ":syntax" shows the help for :syntax. But I'd also like this to work for all the shortcut commands, which is hard without this patch, especially if you want it to be a bit smarter (i.e. load ":syn-match" if you typed :sy match").
|
Ah thanks: C89 style. I'm so used to writing it like this I didn't think about that 😅 I updated the PR and it seems grand now. |
|
Well, but couldn't we instead of this just to omit sorting step while expanding "command" specifically, so both |
I wouldn't be in favour of that myself; I think the completion and "shortcut" logic are quite different things, and I don't think many people would expect the cmdline completion behaviour to be modified based on that. Having |
|
Instead of "shorcut" the term "abbreviation" should be used. This is mentioned in section 20.2 of the user manual. |
|
I avoided using the word "abbreviation" to avoid confusing between this and At any rate, I updated the name to |
…tened one Problem: Not easy to get the full command name from a shortened one. Solution: Add fullcommand(). (Martin Tournoij, closes vim/vim#7777) vim/vim@038e09e
…tened one Problem: Not easy to get the full command name from a shortened one. Solution: Add fullcommand(). (Martin Tournoij, closes vim/vim#7777) vim/vim@038e09e
Right now there is no way to know which shortcut commands refer to which
commands. This adds findcommand() to solve that.
Context: I made a little VimScript to show the help for the command you
typed: pressing while you typed ":syntax" shows the help for
:syntax. But I'd also like this to work for all the shortcut commands,
which is hard without this patch, especially if you want it to be a bit
smarter (i.e. load ":syn-match" if you typed :sy match").