-
Notifications
You must be signed in to change notification settings - Fork 752
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
Add partial support for getcmdtype() function #1039
Conversation
Tests not included
By the way, do you know what the "input command" (labelled
|
The input command is the prompt shown when someone calls the
Now every time you type
You'll get an input prompt for some kind of text (e.g. Vim script to capture something) and typing As for testing, a simple map like that would do it. Something like:
or
etc. Testing the expression register would be very similar, but with a different map:
|
@citizenmatt Thanks a lot for the details. I just added some tests for |
Looks good to me, thanks. I wouldn't worry about debug-mode, it's not supported by IdeaVim. |
Sweet, thank you! |
The
getcmdtype()
could be called from inside a prompt (search, expression, command), or from a remapping. Apparently IdeaVim currently doesn't support nested prompts (e.g. by typing:<C-r>=
to show an expression prompt inside a command prompt), so it wouldn't be functional in that case.It should work in a remapping though, e.g.:
:cnoremap <F2> <C-r>=getcmdtype()<CR>
. Could you advise on how I could unit test this?For context, this is the remap that I'm using this for:
This is so that if you press
<Escape>
during a search before you press enter, it keeps the cursor at the first search result instead of jumping back to where the cursor was before the search started. This enforces a behavior that you find in most text search tools, including IntelliJ's built-in search.