From 592bd76244c07bf8e7d518ac2ccea626a903e333 Mon Sep 17 00:00:00 2001 From: Rikk Date: Thu, 13 Aug 2015 20:22:54 -0300 Subject: [PATCH] [BUG_FIXED] Fix "Open in/Move to new instance" issue (closes #709, fixes the new window always started at top-left corner of screen, and did not remember maximized state. Now it will use the last saved window position and state. --- PowerEditor/src/Notepad_plus.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 00c21277c..c554cf775 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -3272,15 +3272,21 @@ void Notepad_plus::docOpenInNewInstance(FileTransferMode mode, int x, int y) generic_string command = TEXT("\""); command += nppName; command += TEXT("\""); + command += TEXT(" \"$(FULL_CURRENT_PATH)\" -multiInst -nosession"); - command += TEXT(" \"$(FULL_CURRENT_PATH)\" -multiInst -nosession -x"); - TCHAR pX[10], pY[10]; - generic_itoa(x, pX, 10); - generic_itoa(y, pY, 10); + if (x) { + TCHAR pX[10]; + generic_itoa(x, pX, 10); + command += TEXT(" -x"); + command += pX; + } + if (y) { + TCHAR pY[10]; + generic_itoa(y, pY, 10); + command += TEXT(" -y"); + command += pY; + } - command += pX; - command += TEXT(" -y"); - command += pY; command += TEXT(" -l"); command += ScintillaEditView::langNames[buf->getLangType()].lexerName; command += TEXT(" -n");