Skip to content

Commit 0fbc681

Browse files
committed
Revert part of 1a9b82 which reintroduced the bug fixed in b3e974
1 parent 3d258bb commit 0fbc681

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/NotepadNext/DockedEditor.cpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,25 @@ void DockedEditor::dockWidgetCloseRequested()
122122

123123
ads::CDockAreaWidget * DockedEditor::currentDockArea()
124124
{
125-
auto dockWidget = m_DockManager->focusedDockWidget();
125+
QMap<QString, ads::CDockWidget*> dockwidgets = m_DockManager->dockWidgetsMap();
126126

127-
if (dockWidget)
128-
return dockWidget->dockAreaWidget();
129-
else
127+
if (dockwidgets.size() == 0) {
130128
return Q_NULLPTR;
129+
}
130+
else if (dockwidgets.size() == 1) {
131+
// If no dockwidget has had the focus set yet, just return the only one
132+
return dockwidgets.first()->dockAreaWidget();
133+
}
134+
135+
// Search the list for the one that has had the focus set
136+
foreach (ads::CDockWidget* dockWidget, dockwidgets) {
137+
if (dockWidget->property("focused").toBool()) {
138+
return dockWidget->dockAreaWidget();
139+
}
140+
}
141+
142+
// There was no area that had the focus
143+
return Q_NULLPTR;
131144
}
132145

133146
void DockedEditor::addBuffer(ScintillaBuffer *buffer)

src/NotepadNext/NotepadNextApplication.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ bool NotepadNextApplication::initGui()
7373
{
7474
qInfo(Q_FUNC_INFO);
7575

76-
createNewWindow();
76+
createNewWindow()->openFile("C:/pickles.txt");
7777

7878
luabridge::getGlobalNamespace(luaState->L)
7979
.beginNamespace("nn")

0 commit comments

Comments
 (0)