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.
With the power of AceJump it is possible to implement 80 of 87 easymotion commands. This is a wonderful result, I personally expected much fewer commands supported! The rest 7 commands don't seem to be a big deal as well but require a few extra days and more complicated changes in AceJump (some of the commands support jumps between editors). Anyway, we don't have any plans to implement the rest commands in the nearest future.
The result of the work is presented as a IdeaVim-EasyMotion plugin. In order to make all the things work, we have to request some changes in the AceJump plugin. The given pull request consists out of 5 commits that provide some simple extensions of AceJump functionality. Below I'll describe the ideas behinds the commits. I don't insist on a particular design, function names or approaches, so I'll leave it up to the maintainers to use the commits offered or provide a better implementation.
If I don't miss something, currently there is no way to be notified about the acejump lifecycle. The IdeaVim-EasyMotion plugin should know when the AceJump has finished the work, so I've added a listener that does that. The listener contains only a
finished
method, but potentially other functions (likestarted
) could be added as well.For some commands, EasyMotion constructs custom regex and performs the search using it.
Some other commands collect the offsets on their own. So, we need a way to just highlight the offsets and do the "tagging" stuff.
In this case, only one character should be highlighted in the editor. This can be reached by:
regex
= true.Since the constructor of AceJumpModel has internal visibility, we have options to
1.1) Use the default model as a parameter
1.2) Make constructor of AceJumpModel public
This commit uses 1.1 approach.
This commit adds some new within line boundaries. Different approached can be used here as well (for example, convert enum to a class with constants and the possibility to create custom boundaries)
This commit is not really required for EasyMotion, but at some point, I've found out that some of the functions have no usages in the project, but are used in EasyMotion plugin. So, here @ExternalUsage annotation is provided just to mark such functions and do not forget about that in case of refactoring.
As I said above, all the commits are "proposals" and all this can be changed in order to provide a better architecture of AceJump.