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

Cycling through tagged results on screen via "Enter" or "Shift+Enter" keys does not work any more #380

Closed
Skorpionos opened this issue Jul 7, 2021 · 9 comments
Labels

Comments

@Skorpionos
Copy link

Describe the bug
Feature "Pressing Enter or Shift+Enter during a search will cycle through tagged results on screen" doesn't work in new version AceJump

To Reproduce

  1. Activate AceJumpMode
  2. Type something that matches several times
  3. Press "Enter"
  4. See error "File is read-only". Action has no results

Screenshot
acejump

Desktop (please complete the following information):

  • Ubuntu18
  • Clion2021.1.3
  • AceJump 3.8.3
@Skorpionos Skorpionos added the bug label Jul 7, 2021
@breandan
Copy link
Collaborator

breandan commented Jul 7, 2021

This issue is a duplicate of #356 edit: scratch that, this appears to be new. Thank you for reporting!

@breandan breandan closed this as completed Jul 7, 2021
@breandan breandan reopened this Jul 7, 2021
@Skorpionos
Copy link
Author

By the way, I see that key "Alt+Enter" which binds in my case for action "Action: EditorStartNewLine" works instead of "Shift+Enter" for previous match. Maybe there is some workaround instead of "Enter" for next match also?...

@breandan
Copy link
Collaborator

Okay! After some digging, I can reproduce this issue, but only when IdeaVim is active. If IdeaVim is disabled, tag navigation using Enter/Shift+Enter triggers the callback as expected, however when IdeaVim is active (either in normal mode, or insert mode), this causes the caret move in editor, or produces the message File is read-only. To receive callbacks for these events, we are registering an editorActionHandler in our plugin.xml file as follows:

<editorActionHandler action="EditorStartNewLine" order="first"
implementationClass="org.acejump.action.AceEditorAction$SelectBackward"/>
<editorActionHandler action="EditorEnter" order="first"
implementationClass="org.acejump.action.AceEditorAction$SelectForward"/>

When IdeaVim is enabled, this action handler would not appear to work. I wonder if there is a better way to steal editor actions like Enter/Shift+Enter from the IDE when AceJump is active. I remember an older issue (#266) where competing focus occurred in certain IdeaVim modes. @AlexPl292 Should we be doing anything differently here?

@chylex
Copy link
Collaborator

chylex commented Nov 15, 2021

IdeaVIM registers a raw key handler that takes priority over everything else, I ran into a similar issue with one of my plugins. You could try copying my approach and see if that works:

chylex/IntelliJ-Keyboard-Master@e0bd777

@AlexPl292
Copy link
Contributor

IdeaVim had a workaround for AceJump, but it was broken by the last huge refactoring. We are already discussing on how to fix it in a better way. I hope that the fix will be available in the next release.

@AlexPl292
Copy link
Contributor

A fix will be available with the next release of IdeaVim. It was fixed by introducing a dependency to the AceJump plugin, but actually we're discussing IdeaVim keys handling refactoring.

@breandan
Copy link
Collaborator

Much appreciated! Please let us know when your next release is ready for testing and if we need to make any changes to support the integration. We release 3.8.5 when this issue is resolved, alongside the other recent changes.

@AlexPl292
Copy link
Contributor

We've released a new version 1.9.0 with a workaround that should fix the issues. However, we're working on a new shortcut registering mechanism that should fix the issue properly :)

@breandan
Copy link
Collaborator

I have confirmed that AceJump's Enter/Shift+Enter functionality now works again with the latest version of IdeaVim. Thanks for looking into this Alex! We will now release 3.8.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants