Created
April 6, 2019 09:57
-
-
Save jhakonen/88a8e96ddaa4adf0fb558416dec919c4 to your computer and use it in GitHub Desktop.
Possible fixes for zim issue #84
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/zim/gui/widgets.py b/zim/gui/widgets.py | |
| index 1c81e538..4d36cbd2 100644 | |
| --- a/zim/gui/widgets.py | |
| +++ b/zim/gui/widgets.py | |
| @@ -1664,6 +1664,8 @@ def gtk_entry_completion_match_func(completion, key, iter, column): | |
| model = completion.get_model() | |
| text = model.get_value(iter, column) | |
| + # Use non-normalized and non-casefolded key instead for comparison | |
| + key = completion.get_entry().get_text().lower() | |
| if text is not None: | |
| return key in text.lower() | |
| else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/zim/gui/widgets.py b/zim/gui/widgets.py | |
| index 1c81e538..3d645840 100644 | |
| --- a/zim/gui/widgets.py | |
| +++ b/zim/gui/widgets.py | |
| @@ -27,6 +27,7 @@ from gi.repository import Gtk | |
| from gi.repository import Gdk | |
| from gi.repository import Pango | |
| from gi.repository import GdkPixbuf | |
| +from gi.repository import GLib | |
| import logging | |
| @@ -1664,8 +1665,10 @@ def gtk_entry_completion_match_func(completion, key, iter, column): | |
| model = completion.get_model() | |
| text = model.get_value(iter, column) | |
| + text = GLib.utf8_normalize(text, -1, GLib.NormalizeMode.ALL) | |
| + text = GLib.utf8_casefold(text, -1) | |
| if text is not None: | |
| - return key in text.lower() | |
| + return key in text | |
| else: | |
| return False | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment