[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-05-22 Thread Jiří Techet via Github-comments
Looks great, thanks! -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/1328#issuecomment-2125046192 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)

2024-05-22 Thread Jiří Techet via Github-comments
Merged #1328 into master. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/1328#event-12896294105 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)

2024-05-22 Thread cresto sylvain via Github-comments
OK, I did it, is it okay? Thanks -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/1328#issuecomment-2124232024 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)

2024-05-21 Thread Jiří Techet via Github-comments
Also prefix the commit message with `vimode:` so it's clear what plugin the commit modifies. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/1328#issuecomment-2123481464 You are receiving this because you are subscribed to this thread. Message I

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-05-21 Thread Jiří Techet via Github-comments
Looks good, thanks! One last request - would you squash all the commits into one? I'll merge it afterwards. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/1328#issuecomment-2123477613 You are receiving this because you are subscribed to this th

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-05-21 Thread Jiří Techet via Github-comments
@techee approved this pull request. -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/1328#pullrequestreview-2069658017 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)

2024-05-21 Thread cresto sylvain via Github-comments
@scresto09 commented on this pull request. > @@ -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+

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-05-21 Thread cresto sylvain via Github-comments
@scresto09 pushed 1 commit. 63b7e25242e485448c81185eadabab38d7a65b52 Refactor the code to take into account the latest comments -- View it on GitHub: https://github.com/geany/geany-plugins/pull/1328/files/1be4e6adeb28c19ac35c9a9682d21c35f08532f3..63b7e25242e485448c81185eadabab38d7a65b52 You ar

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-05-18 Thread Jiří Techet via Github-comments
@techee requested changes on this pull request. > @@ -219,3 +220,12 @@ void goto_nonempty(ScintillaObject *sci, gint line, > gboolean scroll) pos = NEXT(sci, pos); SET_POS(sci, pos, scroll); } + + +gboolean is_start_of_line(ScintillaObject *sci, gint pos) This function

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-05-17 Thread cresto sylvain via Github-comments
@scresto09 pushed 1 commit. 1be4e6adeb28c19ac35c9a9682d21c35f08532f3 added two empty lines -- View it on GitHub: https://github.com/geany/geany-plugins/pull/1328/files/2b99b719de64166b3833280a5ba0c1fdf00c6a4c..1be4e6adeb28c19ac35c9a9682d21c35f08532f3 You are receiving this because you are subsc

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-05-17 Thread cresto sylvain via Github-comments
@scresto09 commented on this pull request. > @@ -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+

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-05-17 Thread cresto sylvain via Github-comments
@scresto09 pushed 1 commit. 2b99b719de64166b3833280a5ba0c1fdf00c6a4c used goto_nonempty to go to the first non-white character and some more changes -- View it on GitHub: https://github.com/geany/geany-plugins/pull/1328/files/327cdde2d506400ad6e05342c0d6095e9c254e0e..2b99b719de64166b3833280a5b

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-05-15 Thread Jiří Techet via Github-comments
@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)

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-05-15 Thread Jiří Techet via Github-comments
@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(CmdContex

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-05-13 Thread cresto sylvain via Github-comments
You're right, my previous correction was not correct. [327cdde](https://github.com/geany/geany-plugins/pull/1328/commits/327cdde2d506400ad6e05342c0d6095e9c254e0e) is a new fix using the SC_MOD_BEFOREINSERT and SC_PERFORMED_UNDO events to save the cursor position. -- Reply to this email directl

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-05-13 Thread cresto sylvain via Github-comments
@scresto09 pushed 1 commit. 327cdde2d506400ad6e05342c0d6095e9c254e0e use SC_MOD_BEFOREINSERT and SC_PERFORMED_UNDO events to track cursor position to restore after undo -- View it on GitHub: https://github.com/geany/geany-plugins/pull/1328/files/3ee5a5c04c164781ba875f19c296623411cfb880..327cdd

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-05-08 Thread Jiří Techet via Github-comments
But this isn't really what vim does, is it? Try the following with this patch: 1. Delete a line in the middle of a file. 2. Scroll to the top of the file so you have the cursor e.g. on the first line 3. Press `u` The undo happens but your cursor is still on the first line instead of being at the

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-04-25 Thread cresto sylvain via Github-comments
Sure, here's an example: Open a 5 line file Move the cursor to line 2 press "2dd" to delete 2 lines press "u" to cancel With a real VIM, the cursor stays on line 2 With Geany Vimode not patched, the cursor goes to the last line -- Reply to this email directly or view it on GitHub: https://githu

[Github-comments] Re: [geany/geany-plugins] Vimode: fix cursor position after using undo (PR #1328)

2024-04-25 Thread Jiří Techet via Github-comments
Seems to make sense, just curious when the problem exactly happens - could you give an example when the output of the plugin differs from vim? -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/1328#issuecomment-2077625275 You are receiving this bec