[Github-comments] [geany/geany-plugins] git-changebar: Add the possibility to undo hunk at cursor position (#531)

Colomban Wendling notifications at xxxxx
Sat May 13 05:05:15 UTC 2017


b4n commented on this pull request.



> +
+    if (data->found) {
+      ScintillaObject *sci = doc->editor->sci;
+
+      sci_start_undo_action(sci);
+
+      if (data->new_lines > 0) {
+        gint pos = sci_get_position_from_line(sci, data->new_start - 1);
+        sci_set_target_start(sci, pos);
+        pos = sci_get_position_from_line(sci, data->new_start + data->new_lines - 1);
+        sci_set_target_end(sci, pos);
+        sci_replace_target(sci, "", FALSE);
+      }
+
+      if (data->old_lines > 0) {
+        gint line = sci_get_current_line (sci);

hum, OK, the marker comment is a bit misleading, but indeed there's the same problem here, so we indeed need a similar fix, sorry.  But still not relying on the current line should be easy enough and better IMO.

-- 
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-plugins/pull/531#discussion_r116350954
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20170512/8a0aa4be/attachment.html>


More information about the Github-comments mailing list