ghex r1206 - in trunk: . src
- From: jjongsma svn gnome org
- To: svn-commits-list gnome org
- Subject: ghex r1206 - in trunk: . src
- Date: Sun, 4 May 2008 22:17:48 +0100 (BST)
Author: jjongsma
Date: Sun May 4 21:17:48 2008
New Revision: 1206
URL: http://svn.gnome.org/viewvc/ghex?rev=1206&view=rev
Log:
* src/gtkhex.c: fix a bug where the selection would always start at 0 if
the user only used the keyboard. To reproduce, navigate away from the start
of the document, then press Shift+Down, and the text will be selected, but
instead of starting the selection from where the cursor was when you pressed
Down, it would start from the beginning of the file.
Modified:
trunk/ChangeLog
trunk/src/gtkhex.c
Modified: trunk/src/gtkhex.c
==============================================================================
--- trunk/src/gtkhex.c (original)
+++ trunk/src/gtkhex.c Sun May 4 21:17:48 2008
@@ -2154,11 +2154,11 @@
gtk_hex_set_selection(gh, gh->selection.start, gh->cursor_pos);
bytes_changed(gh, MIN(gh->cursor_pos, old_pos), MAX(gh->cursor_pos, old_pos));
}
- else if(gh->selection.end != gh->selection.start) {
+ else {
guint start = MIN(gh->selection.start, gh->selection.end);
guint end = MAX(gh->selection.start, gh->selection.end);
- gh->selection.end = gh->selection.start = 0;
bytes_changed(gh, start, end);
+ gh->selection.end = gh->selection.start = gh->cursor_pos;
}
bytes_changed(gh, old_pos, old_pos);
show_cursor(gh);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]