diff --git a/ChangeLog b/ChangeLog index 2658612b2..dbe8bdb38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,8 @@ into C-locale string (for saving floats in XML) * src/StyleEditor.py (draw): Call locale.str instead of str. * src/TextDoc.py (StyleSheetList.save): Call gformat instead of '%f'. + * src/AutoComp.py (AutoCombo.timer_callback): Fix autocompletion + so that the typed portion of the text is always visible. 2003-06-14 Don Allingham * src/preferences.glade: Don't immediately show preferences dialog diff --git a/src/AutoComp.py b/src/AutoComp.py index 3c45acc57..033dc88ba 100644 --- a/src/AutoComp.py +++ b/src/AutoComp.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2002 Donald N. Allingham +# Copyright (C) 2002-2003 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -222,8 +222,11 @@ class AutoCombo(AutoCompBase): n = self.vals[0] self.nl = string.lower(n) entry.set_text(n) - gtk.Editable.set_position(entry,self.l) - gtk.Editable.select_region(entry,self.l, -1) + # Select non-matching text from the end to the beginning: + # this preserves the visibility of the portion being typed. + ln = len(n) + gtk.Editable.set_position(entry,ln-1) + gtk.Editable.select_region(entry,ln,self.l) else: self.vals = [""]