[ghex/gtk4-port: 89/91] gtkhex: adjust cursor properly upon cut operation




commit b50f66646963c7e5d720d71bce704c178ea58cf5
Author: Logan Rathbone <poprocks gmail com>
Date:   Wed Aug 11 18:57:56 2021 -0400

    gtkhex: adjust cursor properly upon cut operation

 src/gtkhex.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/gtkhex.c b/src/gtkhex.c
index 6a42926b..7134ebfe 100644
--- a/src/gtkhex.c
+++ b/src/gtkhex.c
@@ -2906,11 +2906,11 @@ gtk_hex_delete_selection(GtkHex *gh)
 
        gtk_hex_clear_selection (gh);
 
-       if (start < gh->cursor_pos)
-               gtk_hex_set_cursor (gh, gh->cursor_pos - end + start);
-
        hex_document_delete_data (gh->document,
                        MIN(start, end), len, TRUE);
+
+//     gtk_hex_set_cursor (gh, gh->cursor_pos - end + start);
+       gtk_hex_set_cursor (gh, gh->cursor_pos);
 }
 
 /*


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]