[Github-comments] Re: [geany/geany-plugins] geniuspaste: Port to libsoup3 (and avoid GTK3 deprecations) (PR #1342)
I rebased against master to have a fixed CI, plus added @eht16 Windows bundle fixes -- hopefully this will help testing and finding out what's wrong :) -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/1342#issuecomment-2113570447 You are receiving this because you are subscribed to this thread. Message ID:
[Github-comments] Re: [geany/geany-plugins] geniuspaste: Port to libsoup3 (and avoid GTK3 deprecations) (PR #1342)
@b4n pushed 7 commits. e7f19b79f4b9e200b3e23d645e3cf62c8a7ca7c9 geniuspaste: Port to libsoup3 bb4513ca7e2a7540461d07acbd4a365ce14be802 geniuspaste: Remove use of deprecated GTK API 80607621e5b1569737f3d2da8f3de6d830c9f706 geniuspaste: Enable HTTPS for paste.debian.net 62e02fafb549f6a0be22b9bb78dcda46e49cd9a3 Update CI for libsoup3 b7d63a448e31669fc847fc32c0b8a2881b4e649e geniuspaste: Replace dead dpaste.de with dpaste.org 4e7d6278a906b9d051e242217087e55e460dbf99 geniuspaste: Add dpaste.com 17af2ad0706d7e092a130e6d7f0c091c831c5969 geniuspaste: Silence a harmless warning with GLib 2.76+ -- View it on GitHub: https://github.com/geany/geany-plugins/pull/1342/files/d336856411f9b8897b62c705da5944c29205647b..17af2ad0706d7e092a130e6d7f0c091c831c5969 You are receiving this because you are subscribed to this thread. Message ID:
[Github-comments] Re: [geany/geany-plugins] geniuspaste: Port to libsoup3 (and avoid GTK3 deprecations) (PR #1342)
> Then, I got a compiler warning which might or might not be new but still > worth to look at: > > […] It's actually not an issue (the buffer is taken the line before), but probably worth silencing. > When trying to paste some file, Geany crashes for me when it is executed > natively. I don't know yet why this happens and I didn't manage it yet to > debug it with gdb. This might be related to my system where I use some > firewall rules to block unwanted internet access from Windows and also have > proxy connections configured and after all, it is Windows 7. That's pretty bad :) I'd be nice to have more info, and possibly whether it's new or not. > When I start Geany from within the MSYS2 environment, pasting some file works > to some extend, at least no crash :). But the response look weird: […] The > link below "\1" is actually also "\1". > > The `response_str` in `pastebin_parse_response` is > "https://www.geany.org/p/6vzVo"; which is correct. So there seems to be a > problem with parsing the URL. I don't know if this related to these changes > or not. This is weird, don't you have old leftover configuration for the plugin? This should only happen if your configuration has a `[parse]` section with an incorrect `replace` (if there are none, it would then use the default `\1`), e.g. one referencing a missing group in the `search` pattern. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/1342#issuecomment-2113534651 You are receiving this because you are subscribed to this thread. Message ID:
[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)
@techee commented on this pull request. > + +void start_undo(CmdContext *c) +{ + c->undo_pos = -1; +} + +void update_undo(CmdContext *c, gint pos) +{ + c->undo_pos = pos; +} + +gboolean end_undo(CmdContext *c) +{ + ScintillaObject *sci = c->sci; + + if (c->undo_pos != -1) { Also two empty lines between functions in the file if possible. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/1328#discussion_r1601948996 You are receiving this because you are subscribed to this thread. Message ID:
[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)
@techee requested changes on this pull request. Looks good to me apart from the few formal comments above and the possible `goto_nonempty()` use. Would you incorporate those changes into this PR? > @@ -162,14 +163,14 @@ void cmd_del_word_left(CmdContext *c, CmdParams *p) void cmd_undo(CmdContext *c, CmdParams *p) { gint i; - gint pos = SSM(p->sci, SCI_GETCURRENTPOS, 0, 0); + start_undo(c); for (i = 0; i < p->num; i++) { if (!SSM(p->sci, SCI_CANUNDO, 0, 0)) break; SSM(p->sci, SCI_UNDO, 0, 0); } Shouldn't `goto_nonempty()` be used here to go to the first non-white character on a line? vim seems to behave this way, even though in a bit inconsistent manner - when you perform `dd`, undo goes to the first non-white character while when you use `2dd`, it goes where the cursor was before. If `goto_nonempty()` is used, it should only be run when some actual undo happened and also when the cursor is at the beginning of a line so it doesn't jump somewhere else when you e.g. delete a word in the middle of a sentence. > @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Jiri Techet Your file, your name :-). You can skip the email address if you are worried of spam. > + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __UNDO_H__ +#define __UNDO_H__ + +#include "context.h" + +void start_undo(CmdContext *c); I'd prefer the names to start with `undo_`, so e.g. `undo_start()` here. > + */ + +#include "undo.h" +#include "utils.h" + +void start_undo(CmdContext *c) +{ + c->undo_pos = -1; +} + +void update_undo(CmdContext *c, gint pos) +{ + c->undo_pos = pos; +} + +gboolean end_undo(CmdContext *c) Is the gboolean return value used for anything? > + +void start_undo(CmdContext *c) +{ + c->undo_pos = -1; +} + +void update_undo(CmdContext *c, gint pos) +{ + c->undo_pos = pos; +} + +gboolean end_undo(CmdContext *c) +{ + ScintillaObject *sci = c->sci; + + if (c->undo_pos != -1) { { on a separate line to match the style of the rest of the code. > @@ -0,0 +1,28 @@ +/* + * Copyright 2024 Jiri Techet Like above. > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __UNDO_H__ +#define __UNDO_H__ + +#include "context.h" + +void start_undo(CmdContext *c); +void update_undo(CmdContext *c, gint pos); +gboolean end_undo(CmdContext *c); void instead of gboolean? -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/1328#pullrequestreview-2058491835 You are receiving this because you are subscribed to this thread. Message ID: