|
10 | 10 | import chardet |
11 | 11 | from mtable import MarkupTable |
12 | 12 |
|
13 | | -from .scilib import _SciImSupport, EXTENSION_LEXER |
| 13 | +from .scilib import EXTENSION_LEXER |
14 | 14 |
|
15 | 15 | from .util import toUtf8 |
16 | 16 | from . import __home_data_path__, __data_path__, __default_basename__ |
@@ -75,9 +75,6 @@ def __init__(self, find_dialog, parent=None): |
75 | 75 | self.setCaretLineVisible(True) |
76 | 76 | self.setWrapVisualFlags(QsciScintilla.WrapFlagByBorder) |
77 | 77 |
|
78 | | - self.inputMethodEventCount = 0 |
79 | | - self._imsupport = _SciImSupport(self) |
80 | | - |
81 | 78 | self.cursorPositionChanged.connect(self.onCursorPositionChanged) |
82 | 79 | self.linesChanged.connect(self.onLinesChanged) |
83 | 80 |
|
@@ -146,7 +143,7 @@ def createAction(cls, parent, do_action): |
146 | 143 | action = QtWidgets.QAction(parent.tr('&Find or Replace'), parent) |
147 | 144 | action.setShortcut(QtGui.QKeySequence.Find) |
148 | 145 | action.triggered.connect(partial(do_action, 'find')) |
149 | | - action.setIcon(QtGui.QIcon.fromTheme('edit-find-replace')) |
| 146 | + action.setIcon(QtGui.QIcon.fromTheme('edit-find')) |
150 | 147 | actions['find'] = action |
151 | 148 |
|
152 | 149 | action = QtWidgets.QAction(parent.tr('Find Next'), parent) |
@@ -743,12 +740,14 @@ def do_action(self, action, value): |
743 | 740 | if self.lexer(): |
744 | 741 | tables = None |
745 | 742 | if self.lexer().language() == 'reStructuredText': |
| 743 | + logger.debug('Format rst table: %s' % text) |
746 | 744 | tables = MarkupTable.from_rst(text) |
747 | 745 | elif self.lexer().language() == 'Markdown': |
| 746 | + logger.debug('Format md table: %s' % text) |
748 | 747 | tables = MarkupTable.from_md(text) |
749 | 748 | if tables: |
750 | 749 | mt = tables[0] |
751 | | - if not mt or mt.is_empty(): |
| 750 | + if not mt or mt.is_empty() or mt.is_invalid(): |
752 | 751 | logger.debug('Format text table: %s' % text) |
753 | 752 | mt = MarkupTable.from_txt(text) |
754 | 753 | if self.lexer(): |
|
0 commit comments