Skip to content

Commit 8ff9b04

Browse files
author
Yordan Gigov
committed
Fix multi-instance file path passing
1 parent a0889dd commit 8ff9b04

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/NotepadNext/NotepadNextApplication.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,19 @@ void NotepadNextApplication::sendInfoToPrimaryInstance()
341341

342342
QByteArray buffer;
343343
QDataStream stream(&buffer, QIODevice::WriteOnly);
344+
QStringList argsToSend;
345+
QStringList toFilter = parser.positionalArguments();
346+
for (const QString &arg : arguments()) {
347+
if (toFilter.contains(arg)) {
348+
QFileInfo fileInfo(arg);
349+
argsToSend.push_back(fileInfo.absoluteFilePath());
350+
}
351+
else {
352+
argsToSend.push_back(arg);
353+
}
354+
}
344355

345-
stream << arguments();
356+
stream << argsToSend;
346357
const bool success = sendMessage(buffer);
347358

348359
if (!success) {

0 commit comments

Comments
 (0)