From f130c3dd98f56a6f496f069729bc0e8c93bfe5c8 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Wed, 23 May 2018 20:08:29 +0800 Subject: [PATCH] bug-fix: enter press on an unknown file in file list should not close current tab --- src/vfilelist.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/vfilelist.cpp b/src/vfilelist.cpp index 6d31cc84..ab2a63b6 100644 --- a/src/vfilelist.cpp +++ b/src/vfilelist.cpp @@ -984,10 +984,11 @@ void VFileList::keyPressEvent(QKeyEvent *p_event) QListWidgetItem *item = fileList->currentItem(); if (item) { VFile *fileToClose = NULL; - if (!(p_event->modifiers() & Qt::ControlModifier) - && g_config->getSingleClickClosePreviousTab()) { - VFile *file = getVFile(item); - Q_ASSERT(file); + VFile *file = getVFile(item); + Q_ASSERT(file); + if (p_event->modifiers() == Qt::NoModifier + && g_config->getSingleClickClosePreviousTab() + && file->getDocType() != DocType::Unknown) { if (!editArea->isFileOpened(file)) { VEditTab *tab = editArea->getCurrentTab(); if (tab) {