summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-11-29 10:40:30 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-11-29 10:40:30 +0000
commite79c7d2ce81683f83c03b07dca4762282031bb51 (patch)
tree953683815772ed2a017a7d731caaed50b01c3508 /desktop
parent2f9ac934e6c83ffaf29dedf54fbae8fbf7556b24 (diff)
downloadnetsurf-e79c7d2ce81683f83c03b07dca4762282031bb51.tar.gz
netsurf-e79c7d2ce81683f83c03b07dca4762282031bb51.tar.bz2
Fix caret position after deleting selection. Thanks to Ole Loots.
svn path=/trunk/netsurf/; revision=13193
Diffstat (limited to 'desktop')
-rw-r--r--desktop/textarea.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 1e94c7f1b..efa5ed24e 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -66,7 +66,7 @@ struct line_info {
};
struct text_area {
-
+
int scroll_x, scroll_y; /**< scroll offsets of the textarea
* content
*/
@@ -726,7 +726,7 @@ bool textarea_reflow(struct text_area *ta, unsigned int line)
* \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 @@ bool textarea_keypress(struct text_area *ta, uint32_t key)
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 @@ bool textarea_keypress(struct text_area *ta, uint32_t key)
ta->selection_end, ""))
return false;
+ caret = ta->selection_start;
ta->selection_start = ta->selection_end = -1;
redraw = true;
} else {
@@ -1446,7 +1449,7 @@ void textarea_get_dimensions(struct text_area *ta, int *width, int *height)
}
/**
- * 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