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

Inconsistency of commands behavior between "a" and "i" #1411

Closed
glyh opened this issue Dec 31, 2021 · 6 comments
Closed

Inconsistency of commands behavior between "a" and "i" #1411

glyh opened this issue Dec 31, 2021 · 6 comments
Labels
C-bug Category: This is a bug

Comments

@glyh
Copy link

glyh commented Dec 31, 2021

Reproduction Steps(for different issues)

  1. appending a extends the selection while insertion i didn't, I think they both should
  2. in multi cursor mode, w expands all cursors to words, while x collapse to one line, I think x should expands all cursors to lines.
  3. after copying multi selections, I can only paste one selection, maybe this one is because I don't know the keybinds though...
  4. paste p is can not be multiplied by motions, e.g. 4p will not paste 4 times from clipboard.

Environment

  • Platform: Linux arch 5.15.11-arch2-1 #1 SMP PREEMPT Wed, 22 Dec 2021 09:23:54 +0000 x86_64 GNU/Linux
  • Helix version: helix 0.5.0

helix.log is empty.

@glyh glyh added the C-bug Category: This is a bug label Dec 31, 2021
@glyh
Copy link
Author

glyh commented Dec 31, 2021

For 3, we may pull copy of selections in a new set of registers, e.g. #1 to #0 to store the first 10 selections, closest to the main selection. Or we just dump every selection into one register, (which should have shape assoicate with it, like neovim).

I think both approach are valuable, so they might end up to be different commands?

@Omnikar
Copy link
Contributor

Omnikar commented Dec 31, 2021

  1. Just expanding all the selections to lines is achievable via X. This does not extend to the next line like x does.
  2. If you yank multiple cursors, you need to have multiple cursors to paste everything you yanked.
  3. This is already fixed in master (Allow paste commands to take a count #1261).

@glyh
Copy link
Author

glyh commented Dec 31, 2021

OK, I'll change title specifically to issue 1.

@glyh glyh closed this as completed Dec 31, 2021
@glyh glyh changed the title Inconsistency of commands behavior Inconsistency of commands behavior between Dec 31, 2021
@glyh glyh changed the title Inconsistency of commands behavior between Inconsistency of commands behavior between "a" and "i" Dec 31, 2021
@glyh glyh reopened this Dec 31, 2021
@dead10ck
Copy link
Member

How exactly should insert work if it extends the selection? Are you imagining something like this, where [] denotes the selection and | denotes the head:

[|world] → [hello |world]

If so, this would not work as the code is currently architected, as there are only two ends of a selection: the head and the anchor. The head of the selection is where text is inserted, so in order to continuously insert text to the left, the whole selection must move as well.

@glyh
Copy link
Author

glyh commented Dec 31, 2021

@dead10ck I've think about your situations. That makes sense, but there are also situations you want it to include the selection.

e.g.
[|world] => [|hello world] ==(via ms)==> ["|hello world"].

For now I'll just close this. Maybe these are not that important.

@glyh glyh closed this as completed Dec 31, 2021
@dead10ck
Copy link
Member

Ah, so you're talking about inserting text to the right of the cursor. I do think that would be possible. So there could be insert to the left and right, and append to the left and right. This would also give the converse: appending to the right would keep the selection instead of extending. I could see that being a useful thing for some people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants