Fix E94 on selecting a file when there is only one help window #503
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fix E94 on selecting a file when there is only one help window.
How to recreate
vim -c 'help | only'
:CtrlPMRUFiles
or another CtrlP commandCause
#444 has changed the behavior when the current buffer type is 'help' so that s:openfile() would always use 'b' command. This works well for
:CtrlPBufTag
, but doesn't work for other commands like:CtrlPMRUFiles
.Fix
Use 'b' only if the current buffer type is 'help' and the opening file is the help file itself. Otherwise, use ctrlp#normcmd() function as before. (ctrlp#normcmd() looks for a available normal window to open the file and assumes that a window for 'help' is not available, so, #444 (#437) occurs.)
I also found that md == 't' <c-t>, md == 'h' <c-x> and md == 'v' <c-v> doesn't work for
:CtrlPBufTag
. So I createdl:openmyself
to setl:useb
correctly.Validation
:CtrlPBufTag
without the patch.:CtrlPBufTag
with the patch.