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
Enhancement Request - Multiselect Multipaste Option #850
Comments
Instead of being an option that applies to all pastes forever after, it should be a separate paste command that turns on multi-paste before pasting, does the paste, and turns multi-paste off. Put it in the Edit menu and the popup menu after paste, and allow it to be keybound. |
Neither behaviour is "right", only the user knows which they want, so they should get to choose. But a preference is very inconvenient to change whilst you have a big paste sitting on the clipboard. |
@elextr unless I misunderstood the extremely minimal Scintilla docs, what would be a use case for not wanting "multipaste"? |
From my uses, I think it makes sense to default to presuming the user means every line. I'm not sure I know why a user, especially if they have a big clipboard stored, would expect it to land on line one only if they have multilines selected. Perhaps you could put it as a checkbox in Preferences->Miscellaneous. I've recently seen several other IDE boards, that use Scintilla, having this discussion and most seem to agree that the preferred default is to have multiline pastes paste to each line as the default. |
Most likely the reason it's not the default in Geany is because it was not available when Geany was written and nobody fixed it yet :) |
As of Geany 1.23.1 this seems to be working now. Thanks, I'm pretty sure this can be closed now. |
It doesn't work on 1.29 and the word MULTIPASTE does not exist in the Geany sources, so I suspect you have confused it with something else. |
Are you sure you know what I'm talking about? I don't have 1.29 to test, but hold |
Works for me on 1.29 (git) with Shift+Alt+arrows or using Ctrl+mouse drag. |
@AdamDanischewski Thats not multipaste, thats pasting a rectangular selection as I suggested elsewhere. Multipaste is a different animal. |
@codebrainz Thanks, that's the functionality I was referring to when I opened this -- I am going to close this now. |
It'd be nice if, inside multi-line mode (Shift+Alt+arrows or ctrl+mouse drag as @codebrainz pointed out), Cntrl + V was pasting the same content to every line currently being selected. |
@Akronix thats been discussed many times in other places and so far rejected. |
@Akronix It does that already, that's why this closed. |
@Akronix its not clear if you are talking about 1) pasting a single line on the clipboard to each line in a rectangular selection, or 2) pasting multiple lines from the clipboard to the multiple lines of a rectangular selection. If 1) my answer, if 2) @AdamDanischewski answer :) |
@elextr I think I meant rather the first one. I've done a demo using Atom of the behaviour that I find nice to have 😉 |
@AdamDanischewski yeah! It took you nine months to understand what I was talking about 😜 |
Lol, I'm not sure of the Geany version at the time of the correspondence - yet your issue is now fixed to the best of my ability to discern. Now, it is this new "problem"/non-feature of not multi-pasting text from a single row that is copied. If you copy text from a single row then when you multi-select rows it should be presumed that you expect the copied text to be pasted into each row - otherwise, you would not have made the multi-row selection for the paste. |
This has been discussed elsewhere. Scintilla supports multi-paste into multiple selections, but it is a choice, both single and multiple paste are useful in that situation. The paste command infers the answer from what is on the clipboard, if its a single thing it pastes single and if its a multiple thing it pastes multiple. If the contents of the clipboard is a single entity the paste command cannot read the users mind and decide if they want to paste single or multiple. A separate command is needed (or an option but that is considered to be less user friendly) for the other choice. Pull requests are welcome. |
Its not exactly "mind reading" to presume that someone wants a single row pasted into every row of a multi-line selection. An option being required to turn off this behavior? If you really want to paste to a single line to a single row then don't do a multi-line select beforehand - simply put the cursor where you want and paste it like normal. I realize this enhancement request probably won't get implemented anytime soon, but it would save people time - at the moment to repeat a single row to multi-line paste selection semi-quickly I count the number of lines to paste to, then open up a new scratch tab, type in what I want pasted, hit Ctrl-d (copy line) for the amount of lines to paste to, copy the text, make the multi-line select, then paste, then close my opened scratch tab. Instead of - not counting the number of lines - simply selecting the text, copying it then doing a multi-line select, pasting it to all rows. |
The problem with this argument is that both sides think their option is obvious and clearly the correct one and can't understand the other mob. 😁 In fact they are both right, each solution is useful at times, so as I suggest, why not just have two pastes, one to paste single, and one to paste multiple. Then the only argument is which is default 😁. And that could be solved with the option. |
Sorry for seeming silly, but what are the two options? |
When there is a rectangular selection and a single item on the clipboard the choice is to paste the single item into the first row of the selection or to repeat the single item in every row of the selection. Although from #2317 comes the suggestion that if the clipboard is multi-line that successive lines get pasted into successive rows of the selection, so now there are three options 😁 |
…E_EACH - fixes the paste only one line when a vertical selection is selected.
I might be too closed minded here, but I sincerely don't see the user case for the first one. And when I say user case I mean actual user base demanding this one and complaining about having the second one. |
Yep, I saw it and subscribed to the PR updates. Nice job @AdamDanischewski ! 👏 |
I would like to see the Multipaste option for Scintilla implemented. I hacked together something that works, but someone just needs to add a new option in Preferences somewhere to set it.
add to sciwrappers.c:
void sci_set_multi_paste(ScintillaObject *sci, gboolean mpval) { SSM(sci, SCI_SETMULTIPASTE, SC_MULTIPASTE_EACH, 0); }
add to sciwrappers.h:
void sci_set_multi_paste (ScintillaObject *sci, gboolean mpval);
What works for now, but requires that you modify something in Preferences at least once in the session to get it to fire is adding, the following to editor.c:
sci_set_multi_paste(editor->sci, 1);
To test it out turn on the setting, change a keybinding in Preferences.
Then copy some text to the clipboard, select multilines (Alt+Shift Up/DownArrow) and paste!
Now you should see all pasted text onto each line in the editor.
The text was updated successfully, but these errors were encountered: