-
Notifications
You must be signed in to change notification settings - Fork 91
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
Experimenting with jump modes and multi-caret mode #350
Comments
Hi @chylex, great idea! I like this feature for a few reasons.
Some ways your proposed behavior could be improved:
If you believe the benefits outweigh the disadvantages and want to move forward, happy to consider a PR. If we can iron out the details, I think it deserves a major version release, we should call it |
I'm definitely still figuring out what feels best, and I've likely gone beyond what's reasonable for most users (whether they know use IdeaVim or not), so I'm definitely going to be biased just because I got used to how things work. Currently the "main menu" looks like this: Most actions have Shift modifiers, which are not clear from the tooltip and probably confusing at first. I did just make a change in an attempt to reduce keystrokes to select between caret and another point. I'm not sure how to best explain it, but here are a few examples of actions:
If it seems too complicated, I can make a simplified version that's more like the initial post. You could try https://github.com/chylex/IntelliJ-AceJump/commits/experimental-interactive-modes and let me know which modes and modifier interactions you'd want to keep. To reduce keystrokes for simple jumps, a separate action sounds like the best option - maybe I took out multi-caret mode because some previous changes broke it and the "append to existing selections" modifier does an alright job if you need something more complex than IDEA's Find with 'Add Selection for Next Occurrence' feature. |
Another update with a fresh styling update and color scheme. The video covers:
You may also notice that tags only appear after I type either 2 alphanumeric characters or a special character, the amount is configurable and setting it to 2-3 helps prune tags in dense repetitive text. 2021-01-21.19-22-17-1.mp4I don't plan to PR the current state because to make things simpler when experimenting, I removed even more features and options than with the initial refactor, so I think it'll be easier if I finish the PR for the initial refactor first. |
Hey @chylex, sorry! I lost track of this one for a while, been occupied with some other projects for the last two months. Just wanted to say that all of these improvements look terrific, I really love the new styling updates -- much easier on the eyes. It would be great if you could submit this as a PR, I'd like to merge it into master and give you credit for all your excellent work. Thanks! |
Hi, I have also been quite busy lately, but I tinkered with the current version some more (and started using IdeaVIM so I ended up simplifying some of the modes, and among other things added a Quick Jump keybind that works like the old mode-less AceJump). This is the current state of my branches, you can see that |
Everything before the |
Pinyin should be easy, all reading of editor text goes through Can't remember how much of a pain IdeaVim listeners are now that most global state is gone, but if you can get access to the listener's attached editor then you can use |
Cool, just a reminder that these issues should be fixed by the refactor. They should be verified to be still fixed in master, let me know if you'd like me to do that and update you on whether all of them can be closed now, or you can check it when you have time. #348 (comment) |
I'm not sure how to verify all of these issues, but I take your word for it. Even if we missed a few, most of them are stale anyway, and the stack traces would be too much trouble to debug at this point. Maybe we should just close them and hope for the best, people can always reopen if they encounter them again. |
I suppose so. All the ones with stack traces shouldn't happen because the offending code is gone completely, the rest I verified when I wrote the issues down but it was a while ago. |
Although I was unable to reproduce all of the issues as described, I verified the ones without stack traces and closed the ones with old stack traces. Nice work! |
@chylex What do you want to do about these experimental UX features? Have you gotten a better feel for them and do you think they would be useful to release to a wider audience? Personally, I like the idea of using a tooltip to display richer information (e.g. #227), although I would prefer to avoid duplicating features from IdeaVim/EasyMotion if possible. Happy to restart this discussion at some point, otherwise feel free to close if you're happy with the current functionality. Thanks! |
I don't know, I ended up moving to IdeaVim a while back and making shortcuts for some of these or taking advantage of vim to do the same actions: I find that The So in the end, most of the special actions I came up with are either already in current AceJump or I found a better alternative; they could still be useful for someone who doesn't use IdeaVim, but I kind of lost the ability to judge that. I still like the feature where you can perform an action between two searches: These (especially
and both would guide you with hints like: That could be one option. Another option could be to keep the current cycling system, but include hints and refactor jump modes to allow other plugins (like IdeaVim / EasyMotion) to have more control over jumping, perhaps by extending some class like in AceTagAction in my fork. |
I am all in favor of adding new functionality, and there is probably an unlimited number of features we could implement, but perhaps a better solution might be to conserve our effort and work on improving configurability so that users can define their own custom actions (e.g. in the settings panel or
Agreed. Most of AceJump's special modes are either regex search (e.g. #215) or a jump followed by a subsequent action (e.g. expand selection, go to declaration). These modes feel pretty ad hoc, and as you mention, it would be great to have a more configurable way to automate these kinds of actions (e.g. through better integration with IdeaVim or some other scripting mechanism). |
So, since I've moved to IdeaVIM and am now using it heavily, I ended up integrating parts of EasyMotion into my fork instead of adding a bunch of different modes myself. I feel it's really nice to use that way, though I don't know how much of the fork would be useful to you and the general public. I kept special actions for Declaration / Usages / Intentions / Refactor which I think are useful, and the implementation is pretty clean since I kept my refactor of jump modes: session.startJumpMode { ActionMode(AceTagAction.GoToDeclaration, shiftMode = false) } Here, object GoToDeclaration : AceTagAction() {
override fun invoke(editor: Editor, searchProcessor: SearchProcessor, offset: Int, shiftMode: Boolean, isFinal: Boolean) {
JumpToWordStart(editor, searchProcessor, offset, shiftMode = false, isFinal = isFinal)
val action = if (shiftMode)
IdeActions.ACTION_GOTO_TYPE_DECLARATION
else
IdeActions.ACTION_GOTO_DECLARATION
ApplicationManager.getApplication().invokeLater { performAction(action) }
}
} I think this approach could make AceJump quite extensible by other plugins, and it should be easy to refactor the existing enums if you're interested. There are some interesting things the jump modes can react to, including handling key presses and manually updating the results or changing to a different jump mode: sealed class TypeResult {
object Nothing : TypeResult()
class UpdateResults(val processor: SearchProcessor) : TypeResult()
class ChangeMode(val mode: SessionMode) : TypeResult()
object RestartSearch : TypeResult()
object EndSession : TypeResult()
} My fork doesn't have the listeners EasyMotion uses to listen for accepted tags, since I initially designed the custom jump modes for this purpose, but it wouldn't be a good idea to completely replace the listeners and break EasyMotion again. Unfortunately I didn't have any use for the tooltips anymore, and also ended up removing the "Clone/Move to Caret" and similar actions (though there are still occasions where it's a bit easier to use than vim). The mess of branches in my fork still remains in whatever state they were left last I touched them, so if there's anything from this thread you would like me to adapt & PR, or discuss further, let me know. Otherwise, I'm not planning to further develop the original idea, so feel free to close this. |
This sounds like a great idea and could address the need for more configurability that some users have requested. If you're interested in improving plugin extensibility, I'm all for that, but I think it's a separate topic. Perhaps the best thing for now would be to close this issue and continue the discussion somewhere else. |
I experimented with a major change to how jump modes work. Perhaps a video is best, so I uploaded a recording (or zip download if the video isn't available anymore). I will give context to the video below.
Basically, it moves "jump mode selection" after typing the tag, allowing you to press a single key to select the jump mode:
Here I typed my AceJump shortcut
Alt+J
, then "sp" as the query, followed by the tag. I added a hint tooltip with currently implemented modes:is|Sprint
isS|print
isSp|rint
[isSprintToggled]
but holding Shift selects only a "camel hump":is[Sprint]Toggled
This way of jumping also allowed me to create a neat multi-caret mode. In the video I activate it with
Alt+Shift+J
, and then it works as follows:If you're interested, the current version is in https://github.com/chylex/AceJump/tree/experimental-jump-modes branch. If not, feel free to close the issue.
The text was updated successfully, but these errors were encountered: