Skip to content

Commit 5a0523a

Browse files
committed
fix
1 parent d279f2f commit 5a0523a

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

meditor/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,8 @@ def setupToolbar(self):
405405
newButton.setDefaultAction(self.explorer.action('new_rst'))
406406
tb_normal.addWidget(newButton)
407407

408-
# tb_normal.addAction(self.explorer.action('new_rst'))
409-
# tb_normal.addAction(self.explorer.action('new_md'))
410408
tb_normal.addAction(self.tab_editor.action('open'))
409+
tb_normal.addAction(self.explorer.action('open_workspace'))
411410
tb_normal.addAction(self.tab_editor.action('save'))
412411
tb_normal.addSeparator()
413412
tb_normal.addAction(self.tab_editor.action('undo'))
@@ -418,6 +417,7 @@ def setupToolbar(self):
418417
tb_normal.addAction(self.tab_editor.action('paste'))
419418
tb_normal.addSeparator()
420419
tb_normal.addAction(self.tab_editor.action('find'))
420+
tb_normal.addAction(self.tab_editor.action('format_table'))
421421
tb_normal.addSeparator()
422422
tb_normal.addAction(self.tab_editor.action('zoom_in'))
423423
tb_normal.addAction(self.tab_editor.action('zoom_out'))

meditor/editor.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import chardet
1111
from mtable import MarkupTable
1212

13-
from .scilib import _SciImSupport, EXTENSION_LEXER
13+
from .scilib import EXTENSION_LEXER
1414

1515
from .util import toUtf8
1616
from . import __home_data_path__, __data_path__, __default_basename__
@@ -75,9 +75,6 @@ def __init__(self, find_dialog, parent=None):
7575
self.setCaretLineVisible(True)
7676
self.setWrapVisualFlags(QsciScintilla.WrapFlagByBorder)
7777

78-
self.inputMethodEventCount = 0
79-
self._imsupport = _SciImSupport(self)
80-
8178
self.cursorPositionChanged.connect(self.onCursorPositionChanged)
8279
self.linesChanged.connect(self.onLinesChanged)
8380

@@ -146,7 +143,7 @@ def createAction(cls, parent, do_action):
146143
action = QtWidgets.QAction(parent.tr('&Find or Replace'), parent)
147144
action.setShortcut(QtGui.QKeySequence.Find)
148145
action.triggered.connect(partial(do_action, 'find'))
149-
action.setIcon(QtGui.QIcon.fromTheme('edit-find-replace'))
146+
action.setIcon(QtGui.QIcon.fromTheme('edit-find'))
150147
actions['find'] = action
151148

152149
action = QtWidgets.QAction(parent.tr('Find Next'), parent)
@@ -743,12 +740,14 @@ def do_action(self, action, value):
743740
if self.lexer():
744741
tables = None
745742
if self.lexer().language() == 'reStructuredText':
743+
logger.debug('Format rst table: %s' % text)
746744
tables = MarkupTable.from_rst(text)
747745
elif self.lexer().language() == 'Markdown':
746+
logger.debug('Format md table: %s' % text)
748747
tables = MarkupTable.from_md(text)
749748
if tables:
750749
mt = tables[0]
751-
if not mt or mt.is_empty():
750+
if not mt or mt.is_empty() or mt.is_invalid():
752751
logger.debug('Format text table: %s' % text)
753752
mt = MarkupTable.from_txt(text)
754753
if self.lexer():

meditor/explorer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ def __init__(self, settings, parent, style=None):
7373
action.triggered.connect(self.onWindowsExplorer)
7474
self._actions['explorer'] = action
7575

76-
action = QtWidgets.QAction(self.tr('Open folder'), self)
76+
action = QtWidgets.QAction(self.tr('Open Workspace'), self)
7777
action.triggered.connect(self.onOpenWorkspace)
78+
action.setIcon(QtGui.QIcon.fromTheme('folder-open'))
7879
self._actions['open_workspace'] = action
7980

8081
self.popupMenu = QtWidgets.QMenu(self)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ chardet
77
docutils
88
Markdown
99
python-markdown-mathjax
10+
mtable

0 commit comments

Comments
 (0)