mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
bug-fix: save wrong geometry state in single panel view
This commit is contained in:
parent
365c0ce91f
commit
226263f77c
@ -1311,7 +1311,10 @@ bool VVim::handleKeyPressEvent(int key, int modifiers, int *p_autoIndentPos)
|
||||
case Qt::Key_Escape:
|
||||
{
|
||||
// Clear selection and enter normal mode.
|
||||
clearSelection();
|
||||
bool ret = clearSelection();
|
||||
if (!ret && checkMode(VimMode::Normal)) {
|
||||
emit m_editor->requestCloseFindReplaceDialog();
|
||||
}
|
||||
|
||||
setMode(VimMode::Normal);
|
||||
break;
|
||||
|
@ -154,6 +154,9 @@ signals:
|
||||
// Selection changed by mouse.
|
||||
void selectionChangedByMouse(bool p_hasSelection);
|
||||
|
||||
// Request the edit tab to close find and replace dialog.
|
||||
void requestCloseFindReplaceDialog();
|
||||
|
||||
public slots:
|
||||
virtual void highlightCurrentLine();
|
||||
|
||||
|
@ -1538,6 +1538,10 @@ void VMainWindow::closeEvent(QCloseEvent *event)
|
||||
|
||||
void VMainWindow::saveStateAndGeometry()
|
||||
{
|
||||
// In one panel view, it will save the wrong state that the directory tree
|
||||
// panel has a width of zero.
|
||||
twoPanelView();
|
||||
|
||||
vconfig.setMainWindowGeometry(saveGeometry());
|
||||
vconfig.setMainWindowState(saveState());
|
||||
vconfig.setToolsDockChecked(toolDock->isVisible());
|
||||
|
@ -323,6 +323,10 @@ void VMdTab::setupMarkdownEditor()
|
||||
this, &VEditTab::statusMessage);
|
||||
connect(m_editor, &VEdit::vimStatusUpdated,
|
||||
this, &VEditTab::vimStatusUpdated);
|
||||
connect(m_editor, &VEdit::requestCloseFindReplaceDialog,
|
||||
this, [this](){
|
||||
this->m_editArea->getFindReplaceDialog()->closeDialog();
|
||||
});
|
||||
|
||||
m_editor->reloadFile();
|
||||
m_stacks->addWidget(m_editor);
|
||||
|
Loading…
x
Reference in New Issue
Block a user