Repository navigation
Conversation
Contributor
|
@Axlefublr There seems to be another similar PR open, what the difference? #13698
That is this issue: #2298 |
Contributor
Author
|
haven't seen that one before. they seem to not be separating the pasted selections with anything, making the action more annoying to use. |
Strackeror
pushed a commit
to Strackeror/helix
that referenced
this pull request
Apr 24, 2026
paste_before_all, paste_after_all Co-authored-by: Axlefublr <axlefublr.ls@gmail.com>
Strackeror
pushed a commit
to Strackeror/helix
that referenced
this pull request
Apr 24, 2026
paste_before_all, paste_after_all Co-authored-by: Axlefublr <axlefublr.ls@gmail.com>
Strackeror
pushed a commit
to Strackeror/helix
that referenced
this pull request
Apr 24, 2026
paste_before_all, paste_after_all Co-authored-by: Axlefublr <axlefublr.ls@gmail.com>
Strackeror
pushed a commit
to Strackeror/helix
that referenced
this pull request
Aug 21, 2026
Co-authored-by: Axlefublr <axlefublr.ls@gmail.com>
Co-authored-by: Axlefublr <axlefublr.ls@gmail.com>
Axlefublr
force-pushed
the
Axlefublr/paste_all
branch
from
September 1, 2026 13:12
2016cd1 to
cce3cb5
Compare
Strackeror
pushed a commit
to Strackeror/helix
that referenced
this pull request
Sep 17, 2026
Co-authored-by: Axlefublr <axlefublr.ls@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reawakening of #4694 by @stonewareslord
Say you have this text file, where
{/}denotes a selection's head/cursor, and[/]denotes a selection's anchor/not-cursor.If you
yank,keep_primary_selection, and try to paste somewhere, onlysomewill get pasted.With the new
paste_before_allandpaste_after_allcommands,some,inside, andthatwill all get pasted.So let's open a scratch buffer and try to
paste_before_allNote that your selection ranges are retained. Unlike in the #13600 pr by @nik-rev, that merges the selections into one, which is like... what's even the point?
Retaining the selection ranges lets the feature handle mulitline selections correctly. Let's say I wanted to yank multiple selections, to then join them with commas in a scratch buffer.
If the pastation was merged, I'd be in a bit of a pickle:
If I want to end up with
some text with, inside, that, I can't naivelysplit_selection_on_newline— I would then end up adding a comma aftersome text. I can remove that specific selection to avoid the problem, but it becomes a bit of a massive pain once you scale up the example.But if the selection ranges are retained, now there's no issue:
I can
remove_primary_selectionon the last selection, thena,,And then
join_selections_spacethe entire buffer.I hope you get my point: retaining selections' ranges makes it a lot easier to multiact on them, once you
paste_allthem.Helix is very good at caring about ranges more than lines, and the paste all feature should act no different.
As for why
paste_before_alldoesn't result in this:That is because helix will collapse the multiple selections into one, if you do
a. Curiously, it won't do it withi.The selections need to be separated with something to fight against helix's selection merging behavior, and I thought that a newline is a pretty reasonable choice. Note that this joining newline is not included in your selections, so you won't need to
trim_selectionsfirst or anything of that nature.join_selections_spaceplays pretty well with selections pasted this way, even if you make a paste in the middle of some line, rather than a blank line. You can firstpaste_before_all, do the transformations you might wanna do on the selections, then if you wanted to join them with spaces rather than newlines, you justjoin_selections_spaceand you're done. Surprisingly less edgecasey than I thought it would be.Since the code is mostly by @stonewareslord, I set them as the author of the commit. Because it was a massive pain to update their pr on latest master, I added myself as a co-author :p