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

Enhancement Request - Multiselect Multipaste Option #850

Open
AdamDanischewski opened this issue Jan 3, 2016 · 29 comments
Open

Enhancement Request - Multiselect Multipaste Option #850

AdamDanischewski opened this issue Jan 3, 2016 · 29 comments

Comments

@AdamDanischewski
Copy link

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.

@elextr
Copy link
Member

elextr commented Jan 4, 2016

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.

@codebrainz
Copy link
Member

I think this would fix #841 and #625.

It probably would make sense to just have this be the default behaviour for column insertions.

@elextr
Copy link
Member

elextr commented Jan 4, 2016

It probably would make sense to just have this be the default behaviour for column insertions.

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.

@codebrainz
Copy link
Member

@elextr unless I misunderstood the extremely minimal Scintilla docs, what would be a use case for not wanting "multipaste"?

@AdamDanischewski
Copy link
Author

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.

@codebrainz
Copy link
Member

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 :)

@AdamDanischewski
Copy link
Author

As of Geany 1.23.1 this seems to be working now. Thanks, I'm pretty sure this can be closed now.

@elextr
Copy link
Member

elextr commented Aug 22, 2016

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.

@AdamDanischewski
Copy link
Author

Are you sure you know what I'm talking about? I don't have 1.29 to test, but hold Shift+Alt in geany and select a block of vertical text, then Ctrl+C and move down and enter some empty spaces (enough lines to cover your selection) and go to the top and Ctrl+V if you get pasted what you selected then the issue this Enhancement Request refers to is fulfilled. Before it would only paste one line.

@codebrainz
Copy link
Member

Works for me on 1.29 (git) with Shift+Alt+arrows or using Ctrl+mouse drag.

@elextr
Copy link
Member

elextr commented Aug 23, 2016

@AdamDanischewski Thats not multipaste, thats pasting a rectangular selection as I suggested elsewhere. Multipaste is a different animal.

@AdamDanischewski
Copy link
Author

@codebrainz Thanks, that's the functionality I was referring to when I opened this -- I am going to close this now.

@Akronix
Copy link
Contributor

Akronix commented Sep 5, 2016

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.

@elextr
Copy link
Member

elextr commented Sep 5, 2016

@Akronix thats been discussed many times in other places and so far rejected.

@AdamDanischewski
Copy link
Author

@Akronix It does that already, that's why this closed.

@elextr
Copy link
Member

elextr commented Sep 6, 2016

@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 :)

@Akronix
Copy link
Contributor

Akronix commented Sep 6, 2016

@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 😉
anim

@AdamDanischewski
Copy link
Author

myanimated

Is what I'm talking about.

@AdamDanischewski
Copy link
Author

AdamDanischewski commented Jun 15, 2017

The multiple line paste still needs work, as of Git 1.31.
Here is what works:

What I would like to see working - is when you copy some text from a single line, then select multiple rows in a multi-line select and paste the copied text is pasted into each multi-line row selected.

Instead this is what is happening as of Geany 1.31:
geany

@Akronix
Copy link
Contributor

Akronix commented Jun 15, 2017

@AdamDanischewski yeah! It took you nine months to understand what I was talking about 😜

@AdamDanischewski
Copy link
Author

AdamDanischewski commented Jun 15, 2017

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.

@elextr
Copy link
Member

elextr commented Jun 15, 2017

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.

@AdamDanischewski
Copy link
Author

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.

@elextr
Copy link
Member

elextr commented Jun 16, 2017

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.

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.

@Akronix
Copy link
Contributor

Akronix commented Sep 25, 2019

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.

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?

@elextr
Copy link
Member

elextr commented Sep 25, 2019

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 😁

AdamDanischewski referenced this issue in AdamDanischewski/geany Sep 27, 2019
…E_EACH - fixes the paste only one line when a vertical selection is selected.
@Akronix
Copy link
Contributor

Akronix commented Oct 2, 2019

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 grin

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.

@elextr
Copy link
Member

elextr commented Oct 2, 2019

@Akronix see #2328 for recent developments 😁

@Akronix
Copy link
Contributor

Akronix commented Oct 3, 2019

@Akronix see #2328 for recent developments grin

Yep, I saw it and subscribed to the PR updates. Nice job @AdamDanischewski ! 👏

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

No branches or pull requests

4 participants