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

Implement jumping across splitters #371

Merged
merged 4 commits into from May 11, 2021

Conversation

chylex
Copy link
Collaborator

@chylex chylex commented May 8, 2021

#370

Do you plan to disable auto-scrolling in split-screen sessions or do you think it makes sense to scroll multiple editors to the nearest available match?

For now I made it so only the main editor scrolls if none of the editors have any visible matches. Not sure if it'd be a better idea to scroll another editor if the main editor has no matches, and then allow cycling across splitters, what do you think?

It might be a good idea to disable uppercase/shift selection when switching between editors, but allow it when jumping within the same editor.

Disabled shift for cross-editor jumping, but kept it for TARGET mode.

Cycling with Enter/Shift enter also becomes tricky, not sure how you're planning to handle that.

Cycling is in main editor only, but it could be worth a try to make it so the last tag in the main editor cycles to the first tag in the next editor, and so on.

Note, since @ExternalUsage fun markResults(resultsToMark: SortedSet<Int>) only has a list of offsets, I made it so it only works if there is a single editor. When IdeaVim-EasyMotion starts a session it only has one editor so it will continue to work. @AlexPl292 if you'd like to take advantage of this feature, I added

  • Session.markResults(resultsToMark: Map<Editor, Collection<Int>>)
  • SessionManager.start(mainEditor: Editor, jumpEditors: List<Editor>)

which lets you initiate a session with multiple editors, and then send markers per editor. An example of starting a session with all open editors is in AceAction.kt. Note that Collection<Int> can be FastUtil's IntArrayList to avoid boxing.

Also, @breandan please run your autoformatter on it, I enabled edits by maintainers so you should be able to push it into the branch, and then I think I can squash and force-push into the branch to make sure formatting is correct in the first commit.

@chylex chylex changed the title Implement jumping across splitters (#370) Implement jumping across splitters May 8, 2021
@chylex
Copy link
Collaborator Author

chylex commented May 8, 2021

@AlexPl292 I also changed the type of Tagger.tags from List<Entry<String, Int>> to List<Entry<String, Tag>> to support per-editor tags, it looks like it only affects easymotion's unit tests and not the actual functionality, but wanted to give you a heads-up.

@breandan
Copy link
Collaborator

Also, @breandan please run your autoformatter on it, I enabled edits by maintainers so you should be able to push it into the branch, and then I think I can squash and force-push into the branch to make sure formatting is correct in the first commit.

We're not using an autoformatter, just our best judgement (although I've tried to keep things around 80-ish lines). Happy to merge when you're ready, maybe we can do a soft release this time to give @AlexPl292 a heads up before releasing it to the world. Feel free to bump the version and update the release notes if you're comfortable doing that. Thanks.

@chylex
Copy link
Collaborator Author

chylex commented May 10, 2021

I see. I checked easymotion and it looks like it works fine without needing an update, it just works the "old" way without cross-splitter jumps. Should be easy for easymotion to add support for those if they want.

@chylex
Copy link
Collaborator Author

chylex commented May 10, 2021

Bumped version to 3.8.0.

@breandan breandan merged commit a05e92f into acejump:master May 11, 2021
@chylex chylex deleted the jump-across-splitters branch November 14, 2021 14:38
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.

None yet

2 participants