Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Support combines selections from the register with the current ones and the other way around. #55

Open
NNBnh opened this issue May 1, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@NNBnh
Copy link
Contributor

NNBnh commented May 1, 2022

This would help a lot with manipulate complex multi selection. From Kakoune's keys docs:

Alt-z combines selections from the register with the current ones, whereas Alt-Z combines current selections with the ones in the register; a menu is then displayed which waits for one of the following additional keys:

  • a append selections.
  • u keep a union of selections.
  • i keep an intersection of selections.
  • < select the selection with the leftmost cursor for each pair.
  • > select the selection with the rightmost cursor for each pair.
  • + select the longest selection
  • - select the shortest selection.

(I don't think <, >, + and - is useful)

This require #54 to be done.

@vamolessa
Copy link
Owner

Pepper does not really have a way to save cursors to a register.
What it does is save a path + line + column (main cursor's position).
It could indeed be extended to support multiple cursors as #54 suggests.

However, I'm not sure how that would work when trying to combine cursors from another file.
Say you're on buffer a and bookmark it's current cursor state to register p.
Then you open buffer b.
Now would 'append cursors from register p' ignore that they're buffer a cursors?
Or do nothing in that case? Or even just go to buffer a and restore its selections?

@NNBnh
Copy link
Contributor Author

NNBnh commented May 7, 2022

Sorry for the late reply.

However, I'm not sure how that would work when trying to combine cursors from another file.
Say you're on buffer a and bookmark it's current cursor state to register p.
Then you open buffer b.
Now would 'append cursors from register p' ignore that they're buffer a cursors?
Or do nothing in that case? Or even just go to buffer a and restore its selections?

So I have reinstall Kakoune and try this out:

  • Save selections to the register '^' (default marks register on Kakoune) on buffer A.
  • Open buffer B.
  • Press Alt-z or Alt-Z.

Both display this message:

image

We could make Pepper behave the same.

@vamolessa vamolessa added the enhancement New feature or request label Aug 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants