From ccd68b1e221246dd898d78ad81d9e5edead339e0 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Mon, 4 Dec 2017 15:57:47 +0100 Subject: [PATCH 1/2] formatting: check words' regexp --- plover/formatting.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plover/formatting.py b/plover/formatting.py index 9edf3bf86..fc37bd0e0 100644 --- a/plover/formatting.py +++ b/plover/formatting.py @@ -164,6 +164,7 @@ def iter_last_words(self, strip=False, rx=WORD_RX): passed as , then it must include trailing whitespace as part of each word. """ + assert not rx.groups for fragment in self.iter_last_fragments(): # Split each fragment into words. for word in reversed(rx.findall(fragment)): From f7747ff31e1f15f638758ca5cb52f65bc386f391 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Mon, 4 Dec 2017 15:58:47 +0100 Subject: [PATCH 2/2] gui_qt/suggestions: fix suggestions Take into account changes to formatting's API. --- plover/gui_qt/suggestions_dialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plover/gui_qt/suggestions_dialog.py b/plover/gui_qt/suggestions_dialog.py index 9a401ab8e..cb6310177 100644 --- a/plover/gui_qt/suggestions_dialog.py +++ b/plover/gui_qt/suggestions_dialog.py @@ -33,7 +33,7 @@ class SuggestionsDialog(Tool, Ui_SuggestionsDialog): ROLE = 'suggestions' SHORTCUT = 'Ctrl+J' - WORD_RX = re.compile(r'((\w+|[^\w\s]+)\s*)') + WORD_RX = re.compile(r'(?:\w+|[^\w\s]+)\s*') STYLE_TRANSLATION, STYLE_STROKES = range(2)