Skip to content

Commit 0a4cc45

Browse files
committed
Add --workspace option to open a folder as a workspace
1 parent 79edd66 commit 0a4cc45

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/NotepadNext/NotepadNextApplication.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ void parseCommandLine(QCommandLineParser &parser, const QStringList &args)
5656
parser.addOptions({
5757
{"translation", "Overrides the system default translation.", "translation"},
5858
{"reset-settings", "Resets all application settings."},
59-
{"n", "Places the cursor on the line number for the first file specified", "line number"}
59+
{"n", "Places the cursor on the line number for the first file specified", "line number"},
60+
{"workspace", "Opens the specified folder as a workspace", "workspace path"}
6061
});
6162

6263
parser.process(args);
@@ -207,6 +208,14 @@ bool NotepadNextApplication::init()
207208
// Everything should be ready at this point
208209

209210
window->restoreWindowState();
211+
212+
// Check this after restoring the state, as the state contains the previous visibility state of the FAW dock
213+
if (parser.isSet("workspace")) {
214+
const QString dir = parser.value("workspace");
215+
qInfo("Opening folder as workspace: %s", qUtf8Printable(dir));
216+
window->setFolderAsWorkspacePath(dir);
217+
}
218+
210219
window->show();
211220

212221
DebugManager::resumeDebugOutput();

0 commit comments

Comments
 (0)