aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2015-03-19 23:18:14 +0100
committerThomas White <taw@bitwiz.org.uk>2015-03-19 23:18:14 +0100
commitd95d80098f3ce5c374ffe74fb52b6bc8871bbd47 (patch)
treecc5dde92fa95a79bfe456fdf3d09715857a60a60
parent55297a89a43e7e0c5fb7e3c4d182108b7ab8a004 (diff)
Set cursor position on first click
-rw-r--r--src/sc_editor.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c
index 71cdc7f..113573d 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -878,6 +878,10 @@ static gboolean button_press_sig(GtkWidget *da, GdkEventButton *event,
e->drag_status = DRAG_STATUS_NONE;
e->drag_reason = DRAG_REASON_NONE;
e->selection = clicked;
+ e->cursor_frame = clicked;
+ find_cursor(clicked, x-clicked->x, y-clicked->y,
+ &e->cursor_line, &e->cursor_box,
+ &e->cursor_pos);
}