Skip to content
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

IdeaVim integration #307

Merged
merged 5 commits into from
Oct 18, 2019
Merged

IdeaVim integration #307

merged 5 commits into from
Oct 18, 2019

Conversation

AlexPl292
Copy link
Contributor

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.

  1. Add listeners for AceJump lifecycle

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 (like started) could be added as well.

  1. Custom regex search support

For some commands, EasyMotion constructs custom regex and performs the search using it.

  1. Custom offsets provider support

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:

  1. Using AceJumpModel with 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
  2. Perform some work to make highlighting length configurable independent of AceJumpModel.

This commit uses 1.1 approach.

  1. Add within line boundaries

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)

  1. Mark some functions as externally used

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.

@breandan
Copy link
Collaborator

One of the cleanest PR's we've ever received. Merged with very minor revisions in 84329aa. Thank you for the contribution!

@breandan
Copy link
Collaborator

breandan commented Apr 3, 2021

This PR was lost in #353 and needs to be reimplemented.

breandan added a commit that referenced this pull request Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants