Hello,

Comment: fix positioning of the caret after selected text region got deleted.

This patch just sets the caret position to selection_start when an delete input comes in. (desktop/textarea.c)

Please commit or reject.

Thanks & Greets,
m
Index: textarea.c
===================================================================
--- textarea.c  (Revision 13190)
+++ textarea.c  (Arbeitskopie)
@@ -66,7 +66,7 @@
 };
 
 struct text_area {
-       
+
        int scroll_x, scroll_y;         /**< scroll offsets of the textarea
                                         * content
                                         */
@@ -726,7 +726,7 @@
  * \param y1   bottom Y coordinate of redraw area
  * \param ctx  current redraw context
  */
-void textarea_redraw(struct text_area *ta, int x, int y, 
+void textarea_redraw(struct text_area *ta, int x, int y,
                const struct rect *clip, const struct redraw_context *ctx)
 {
        const struct plotter_table *plot = ctx->plot;
@@ -961,6 +961,8 @@
                                                ta->selection_start,
                                                ta->selection_end, ""))
                                        return false;
+
+                               caret = ta->selection_start;
                                ta->selection_start = ta->selection_end = -1;
                                redraw = true;
                        } else {
@@ -1124,6 +1126,7 @@
                                                ta->selection_end, ""))
                                        return false;
 
+                               caret = ta->selection_start;
                                ta->selection_start = ta->selection_end = -1;
                                redraw = true;
                        } else {
@@ -1446,7 +1449,7 @@
 }
 
 /**
- * Set the dimensions of a textarea, causing a reflow and 
+ * Set the dimensions of a textarea, causing a reflow and
  * emitting a redraw request.
  *
  * \param width        the new width of the textarea

Reply via email to