Re: [Github-comments] [geany/geany] Multipaste (#2328)
AdamDanischewski commented on this pull request. The change request from b4n is already implemented. > editor->sci = editor_create_widget(editor); + sci_set_multipaste(editor->sci, SC_MULTIPASTE_EACH); That's where it is now. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#pullrequestreview-297814298
Re: [Github-comments] [geany/geany] Multipaste (#2328)
Akronix commented on this pull request. > @@ -93,6 +93,10 @@ sptr_t sci_send_message_internal (const gchar *file, guint > line, ScintillaObject } #endif + /* Set multi paste setting (at 3104 scintilla defaults to SC_MULTIPASTE_ONCE) */ +void sci_set_multipaste(ScintillaObject *sci, gint mpval) { + SSM(sci, SCI_SETMULTIPASTE, mpval, 0); +} Related discussion can be found in #2317 and in #850 -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#discussion_r330680948
Re: [Github-comments] [geany/geany] Multipaste (#2328)
codebrainz commented on this pull request. > @@ -56,162 +57,162 @@ void > sci_set_current_position(ScintillaObject *sci, gint position, gboolean gint sci_get_selection_start (ScintillaObject *sci); gint sci_get_selection_end (ScintillaObject *sci); -void sci_replace_sel (ScintillaObject *sci, const gchar *text); +void sci_replace_sel (ScintillaObject *sci, const gchar *text); > The indentation is horrid in this file :+1: At some point I'll probably make a PR to reformat this header to follow Geany's coding style. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#discussion_r330326753
Re: [Github-comments] [geany/geany] Multipaste (#2328)
> @b4n It sounds like you're not really interested in crediting me for fixing > this - does this mean I won't be added to the list of contributors? To be blunt, I really don't care who's credited here :) But I'll happily credit you, my example was not trying to draw it away from you. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#issuecomment-537174507
Re: [Github-comments] [geany/geany] Multipaste (#2328)
Don't worry guys, all fixed. =) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#issuecomment-537102001
Re: [Github-comments] [geany/geany] Multipaste (#2328)
@AdamDanischewski pushed 2 commits. a1a185e87c085d330c15e623f5005886ce5c24b0 Reverted - a blank line at the end was missing 79923d281814d95ffebe1a2cb44381cd31d7d4b1 Moved SC_MULTIPASTE_EACH setting to create_new_sci() where the other direct scintilla settings are. -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/2328/files/b78159d71fa989132155ccd879e79ae24df00e76..79923d281814d95ffebe1a2cb44381cd31d7d4b1
Re: [Github-comments] [geany/geany] Multipaste (#2328)
@b4n It sounds like you're not really interested in crediting me for fixing this - does this mean I won't be added to the list of contributors? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#issuecomment-537078532
Re: [Github-comments] [geany/geany] Multipaste (#2328)
Better. IMO we should just use my version that has all the small things I'd like to see changed here (comment, location of the change (which is my bad because of an incorrect comment, sorry), no leftover unrelated whitespace changes, clearer commit message, no leftover history), but basically I'm now happy with the spirit of the changes here. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#issuecomment-537073959
Re: [Github-comments] [geany/geany] Multipaste (#2328)
b4n commented on this pull request. > editor->sci = editor_create_widget(editor); + sci_set_multipaste(editor->sci, SC_MULTIPASTE_EACH); My bad, I meant `create_new_sci()` which is the one having the other similar defaults -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#discussion_r330101585
Re: [Github-comments] [geany/geany] Multipaste (#2328)
Updated - SC_MULTIPASTE_EACH is now set in geany/src/editor.c::editor_create_widget() without any wrappers since this is now the default. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#issuecomment-537068513
Re: [Github-comments] [geany/geany] Multipaste (#2328)
@AdamDanischewski pushed 1 commit. b78159d71fa989132155ccd879e79ae24df00e76 Setting SC_MULTIPASTE_EACH is no longer exposed -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/2328/files/921142866e85a851ca2341f4ce16e96c6d6d6959..b78159d71fa989132155ccd879e79ae24df00e76
Re: [Github-comments] [geany/geany] Multipaste (#2328)
@AdamDanischewski pushed 1 commit. 921142866e85a851ca2341f4ce16e96c6d6d6959 Setting SC_MULTIPASTE_EACH no longer exposed -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/2328/files/f22fc13f9d19b68c5dcac2bba3165dfc575ecaef..921142866e85a851ca2341f4ce16e96c6d6d6959
Re: [Github-comments] [geany/geany] Multipaste (#2328)
@AdamDanischewski pushed 1 commit. f22fc13f9d19b68c5dcac2bba3165dfc575ecaef SC_MULTIPASTE_EACH is default -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/2328/files/63d3a9b04230129a296d991a73388412971966e3..f22fc13f9d19b68c5dcac2bba3165dfc575ecaef
Re: [Github-comments] [geany/geany] Multipaste (#2328)
AdamDanischewski commented on this pull request. > @@ -39,9 +39,10 @@ sptr_t sci_send_message_internal (const gchar *file, guint > line, ScintillaObject # endif #endif -void sci_set_text (ScintillaObject *sci, const gchar *text); -gboolean sci_has_selection (ScintillaObject *sci); -void sci_end_undo_action (ScintillaObject *sci); +voidsci_set_multipaste (ScintillaObject *sci, gint mpval); Again the reason I did this is because @elextr suggested that it should be an option. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#discussion_r330068868
Re: [Github-comments] [geany/geany] Multipaste (#2328)
AdamDanischewski commented on this pull request. > @@ -56,162 +57,162 @@ void > sci_set_current_position(ScintillaObject *sci, gint position, gboolean gint sci_get_selection_start (ScintillaObject *sci); gint sci_get_selection_end (ScintillaObject *sci); -void sci_replace_sel (ScintillaObject *sci, const gchar *text); +void sci_replace_sel (ScintillaObject *sci, const gchar *text); The indentation is horrid in this file - I tried to be nice, it won't happen again. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#discussion_r330066565
Re: [Github-comments] [geany/geany] Multipaste (#2328)
AdamDanischewski commented on this pull request. > @@ -93,6 +93,10 @@ sptr_t sci_send_message_internal (const gchar *file, guint > line, ScintillaObject } #endif + /* Set multi paste setting (at 3104 scintilla defaults to SC_MULTIPASTE_ONCE) */ +void sci_set_multipaste(ScintillaObject *sci, gint mpval) { + SSM(sci, SCI_SETMULTIPASTE, mpval, 0); +} The reason I did this is because @elextr suggested that it should be an option. I agree that it should be the only behavior. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#discussion_r330064994
Re: [Github-comments] [geany/geany] Multipaste (#2328)
elextr commented on this pull request. > @@ -56,162 +57,162 @@ void > sci_set_current_position(ScintillaObject *sci, gint position, gboolean gint sci_get_selection_start (ScintillaObject *sci); gint sci_get_selection_end (ScintillaObject *sci); -void sci_replace_sel (ScintillaObject *sci, const gchar *text); +void sci_replace_sel (ScintillaObject *sci, const gchar *text); Yeah, but to return it to its original state only needs `git checkout src/sciwrappers.h`. There was so much noise I didn't even notice that there was an actual change. @b4n did better. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#discussion_r329870111
Re: [Github-comments] [geany/geany] Multipaste (#2328)
codebrainz commented on this pull request. > @@ -56,162 +57,162 @@ void > sci_set_current_position(ScintillaObject *sci, gint position, gboolean gint sci_get_selection_start (ScintillaObject *sci); gint sci_get_selection_end (ScintillaObject *sci); -void sci_replace_sel (ScintillaObject *sci, const gchar *text); +void sci_replace_sel (ScintillaObject *sci, const gchar *text); To be fair, aligning stuff like this (GNU/GTK+-style) is a terrible idea, especially when tabs are used. Not sure why this one file in Geany uses this alignment style. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#discussion_r329830688
Re: [Github-comments] [geany/geany] Multipaste (#2328)
b4n requested changes on this pull request. With a quick test, I agree that changing the behavior makes sense and is mostly compatible. For the implementation part, I think this should be all what's needed (no need for a new Scintilla wrapper for something only used once in *editor.c*, and the function shouldn't be exposed in the headers anyway): ```diff >From 9b503708203a4986736da33d882f695dee6119c0 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Mon, 30 Sep 2019 20:09:12 +0200 Subject: [PATCH] Enable multi-selection clipboard paste When pasting a single-line clipboard content inside multiple or rectangular selections, paste it in each selection rather than only in the main one. This changes behavior, but the old behavior is easily reproduced by canceling a multiple selection when a single paste is desired, whereas it was not possible to obtain multiple pastes before. diff --git a/src/editor.c b/src/editor.c index df25c8808..b02705e36 100644 --- a/src/editor.c +++ b/src/editor.c @@ -4940,6 +4940,10 @@ static ScintillaObject *create_new_sci(GeanyEditor *editor) #endif SSM(sci, SCI_SETRECTANGULARSELECTIONMODIFIER, rectangular_selection_modifier, 0); + /* With multiple selections, paste in them all (doesn't affect pasting +* multi-line data in a rectangular selection) */ + SSM(sci, SCI_SETMULTIPASTE, SC_MULTIPASTE_EACH, 0); + /* virtual space */ SSM(sci, SCI_SETVIRTUALSPACEOPTIONS, editor_prefs.show_virtual_space, 0); ``` I'd be happy to get this through, but I won't open a new PR just yet (hehe) and I can't push here. Of course I can create a new PR if @elextr's happy with it ;) > editor->sci = editor_create_widget(editor); + sci_set_multipaste(editor->sci, SC_MULTIPASTE_EACH); This should go in `editor_create_widget()` along the other similar ones. > @@ -93,6 +93,10 @@ sptr_t sci_send_message_internal (const gchar *file, guint > line, ScintillaObject } #endif + /* Set multi paste setting (at 3104 scintilla defaults to SC_MULTIPASTE_ONCE) */ +void sci_set_multipaste(ScintillaObject *sci, gint mpval) { + SSM(sci, SCI_SETMULTIPASTE, mpval, 0); +} We don't actually need a new wrapper for just one call, especially not when that call is in *editor.c*. > @@ -39,9 +39,10 @@ sptr_t sci_send_message_internal (const gchar *file, guint > line, ScintillaObject # endif #endif -void sci_set_text (ScintillaObject *sci, const gchar *text); -gboolean sci_has_selection (ScintillaObject *sci); -void sci_end_undo_action (ScintillaObject *sci); +voidsci_set_multipaste (ScintillaObject *sci, gint mpval); This should be in the `GEANY_PRIVATE` section below. Only plugin API functions should be outside of it. > @@ -56,162 +57,162 @@ void > sci_set_current_position(ScintillaObject *sci, gint position, gboolean gint sci_get_selection_start (ScintillaObject *sci); gint sci_get_selection_end (ScintillaObject *sci); -void sci_replace_sel (ScintillaObject *sci, const gchar *text); +void sci_replace_sel (ScintillaObject *sci, const gchar *text); Please don't rewrite unrelated indentation, even if it was incorrect (and here it's not, Geany uses a tab width of 4, which aligns well). Changes like this make it a lot harder to read the actual, meaningful changes, and should be made in a specific commit if at all. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#pullrequestreview-295163357
Re: [Github-comments] [geany/geany] Multipaste (#2328)
I tried to be nice and clean it up, I really don't have time for this project. Go ahead and review the code and put it through or let me know if there is an actual problem. The team here seems very ungrateful for an extra helping hand at fixing a problem that's making Geany look bad. @elextr You can open up your own PR for the cosmetics. ;-) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#issuecomment-536293221
Re: [Github-comments] [geany/geany] Multipaste (#2328)
@AdamDanischewski Geany operates on tab == 4 not tab == 8, please set Geany correctly and undo your alignment changes to sciwrapper.h -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#issuecomment-536248304
Re: [Github-comments] [geany/geany] Multipaste (#2328)
And FGS don't make another PR do it on this one :grin: -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#issuecomment-536248325
Re: [Github-comments] [geany/geany] Multipaste (#2328)
This also has comments, it still needs to be re-reviewed. No? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#issuecomment-536234304
Re: [Github-comments] [geany/geany] Multipaste (#2328)
Ideally the latter two PRs would be closed and the original updated since it has comments and reviews on it. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#issuecomment-53645
Re: [Github-comments] [geany/geany] Multipaste (#2328)
@codebrainz They are the same. #2325 was approved but had a subsequent update. I'll keep it on the same PR in the future. For now I'll leave this open since there is no point to going back to #2325. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#issuecomment-536214261
Re: [Github-comments] [geany/geany] Multipaste (#2328)
This looks like the same topic/changes as #2325 and #2327. Please don't make multiple PRs for the same thing, just update the original one (ie. #2325). If you're having problems with Git, which is completely understandable as it has a steep learning curve, just ask about it in the comments or on the mailing list or IRC or wherever. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/2328#issuecomment-536135901