From 01a28058fc869ebef7dc90b9507ed294ff0af216 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 30 Sep 2018 09:33:10 +0000 Subject: [PATCH] Core: LocalProcess cd fix git-svn-id: svn://ultimatepp.org/upp/trunk@12320 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/LocalProcess.cpp | 2 +- uppsrc/ide/Insert.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/uppsrc/Core/LocalProcess.cpp b/uppsrc/Core/LocalProcess.cpp index c55c3c800..19de76d1b 100644 --- a/uppsrc/Core/LocalProcess.cpp +++ b/uppsrc/Core/LocalProcess.cpp @@ -85,7 +85,7 @@ bool Win32CreateProcess(const char *command, const char *envptr, STARTUPINFOW& s memcpy(env, wenv, (len + 2) * sizeof(wchar)); } #endif - return CreateProcessW(NULL, cmd, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, (void *)envptr, wcd, &si, &pi); + return CreateProcessW(NULL, cmd, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, (void *)envptr, cd ? ~wcd : NULL, &si, &pi); } #endif diff --git a/uppsrc/ide/Insert.cpp b/uppsrc/ide/Insert.cpp index 9a1520bcf..c94ed14cc 100644 --- a/uppsrc/ide/Insert.cpp +++ b/uppsrc/ide/Insert.cpp @@ -197,6 +197,14 @@ void Ide::EditorMenu(Bar& bar) InsertAdvanced(bar); bar.MenuSeparator(); OnlineSearchMenu(bar); + bar.Add(IsClipboardAvailableText() && (editor.IsSelection() || editor.GetLength() < 1024*1024), + "Compare with clipboard..", [=]() { + DiffDlg dlg; + dlg.diff.left.RemoveFrame(dlg.p); + dlg.diff.Set(ReadClipboardText(), editor.IsSelection() ? editor.GetSelection() + : editor.Get()); + dlg.Run(); + }); bar.MenuSeparator(); editor.StdBar(bar); }