diff --git a/src/editor/edit-widget.h b/src/editor/edit-widget.h
index 18ab9b6..73d51d4 100644
a
|
b
|
struct WEdit |
95 | 95 | int column1; /* position of column highlight start */ |
96 | 96 | int column2; /* position of column highlight end */ |
97 | 97 | long bracket; /* position of a matching bracket */ |
| 98 | gboolean mark_dragged; /* flag to save if mouse was dragged to select something */ |
98 | 99 | |
99 | 100 | /* cache speedup for line lookups */ |
100 | 101 | int caches_valid; |
diff --git a/src/editor/editwidget.c b/src/editor/editwidget.c
index 9a49bed..efc16db 100644
a
|
b
|
edit_event (Gpm_Event * event, void *data) |
159 | 159 | goto update; |
160 | 160 | } |
161 | 161 | |
162 | | /* A lone up mustn't do anything */ |
163 | | if (edit->mark2 != -1 && event->type & (GPM_UP | GPM_DRAG)) |
164 | | return MOU_NORMAL; |
165 | | |
166 | 162 | if (event->type & (GPM_DOWN | GPM_UP)) |
167 | 163 | edit_push_key_press (edit); |
168 | 164 | |
… |
… |
edit_event (Gpm_Event * event, void *data) |
195 | 191 | edit_move_to_prev_col (edit, edit_bol (edit, edit->curs1)); |
196 | 192 | |
197 | 193 | if (event->type & GPM_DOWN) |
| 194 | edit->mark_dragged = FALSE; /* reset dragged flag */ |
| 195 | |
| 196 | if ((event->type & GPM_DRAG) && !edit->mark_dragged) |
198 | 197 | { |
199 | | edit_mark_cmd (edit, 1); /* reset */ |
200 | | edit->highlight = 0; |
| 198 | edit_mark_cmd (edit, 1); /* clear selection */ |
| 199 | edit_mark_cmd (edit, 0); /* begin selection */ |
| 200 | edit->mark_dragged = TRUE; |
201 | 201 | } |
202 | | |
203 | | if (!(event->type & GPM_DRAG)) |
204 | | edit_mark_cmd (edit, 0); |
| 202 | else if ((event->type & GPM_UP) && edit->mark_dragged) |
| 203 | edit_mark_cmd (edit, 0); /* end selection */ |
205 | 204 | |
206 | 205 | update: |
207 | 206 | edit_find_bracket (edit); |