Two fixes for context#util#map_H
#156
Open
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.
Hello Christian! I've been using context.vim for over a year and it's been great :) Thanks very much for considering my PR.
First issue
When
context#util#map_His deciding which line to jump to, it accounts for the border ofcontext.vim's popup window even when the popup window isn't present. So if there is no popup window, it jumps to the wrong line - just one line below where it should be going.The fix is to only account for the border if
w:context.linesis non-empty. If there is now:context.lines, then there is no popup window and no border to account for.Second issue
If I understand correctly,
context#util#map_Hemits an\<Esc>in order to clear the already-typed count... but if no count was passed, there is nothing for the\<Esc>to clear. On my terminal, this causes an annoying chirp sound.The fix is to emit the
\<Esc>only if the user typed a count.