From 4262f70bd5c10c0315ae75b0159eda591acdcec3 Mon Sep 17 00:00:00 2001 From: chrys Date: Thu, 22 Dec 2016 21:44:48 +0100 Subject: [PATCH] fix space to often --- .../onInput/45000-present_char_if_cursor_change_horizontal.py | 3 +-- src/fenrir/core/punctuationManager.py | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fenrir/commands/onInput/45000-present_char_if_cursor_change_horizontal.py b/src/fenrir/commands/onInput/45000-present_char_if_cursor_change_horizontal.py index 0926b53e..3666c2e9 100644 --- a/src/fenrir/commands/onInput/45000-present_char_if_cursor_change_horizontal.py +++ b/src/fenrir/commands/onInput/45000-present_char_if_cursor_change_horizontal.py @@ -36,8 +36,7 @@ class command(): if not self.env['runtime']['cursorManager'].isCursorHorizontalMove(): return x, y, currChar = char_utils.getCurrentChar(self.env['screenData']['newCursor']['x'], self.env['screenData']['newCursor']['y'], self.env['screenData']['newContentText']) - if not currChar.isspace(): - self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True) + self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True) def setCallback(self, callback): pass diff --git a/src/fenrir/core/punctuationManager.py b/src/fenrir/core/punctuationManager.py index 2aa14f25..bacbe0b8 100644 --- a/src/fenrir/core/punctuationManager.py +++ b/src/fenrir/core/punctuationManager.py @@ -43,8 +43,10 @@ class punctuationManager(): resultText = str(text) if punctuationDict and punctuation and punctuation != '': + if ' ' in punctuation: + resultText = resultText.replace(' ',' ' + punctuationDict[' '] + ' ') for key,item in punctuationDict.items(): - if key in punctuation: + if key in punctuation and key not in ' ': if self.env['runtime']['settingsManager'].getSetting('general', 'respectPunctuationPause') and \ len(key) == 1 and \ key in ",.;:?!-":