From 8039327eda167568fa2a2bb5f234c3ab988687f9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 23 Feb 2014 22:48:39 +0530 Subject: [PATCH] Edit book: Fix option to disable showing the character before cursor not working --- src/calibre/gui2/tweak_book/ui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/tweak_book/ui.py b/src/calibre/gui2/tweak_book/ui.py index 775c177409..baef400254 100644 --- a/src/calibre/gui2/tweak_book/ui.py +++ b/src/calibre/gui2/tweak_book/ui.py @@ -188,13 +188,13 @@ class CursorPositionWidget(QWidget): # {{{ self.la.setText('') else: try: - name = unicodedata.name(character, None) if character else None + name = unicodedata.name(character, None) if character and tprefs['editor_show_char_under_cursor'] else None except Exception: name = None text = _('Line: {0} : {1}').format(line, col) if not name: name = {'\t':'TAB'}.get(character, None) - if name: + if name and tprefs['editor_show_char_under_cursor']: text = name + ' : ' + text self.la.setText(text) # }}}