From bd6e8aec285b9d876166ab02e72bb2a1b5d8b4c1 Mon Sep 17 00:00:00 2001 From: klugier Date: Sun, 3 Apr 2016 13:53:54 +0000 Subject: [PATCH] Full improvements for #1402 git-svn-id: svn://ultimatepp.org/upp/trunk@9670 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/idefile.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/uppsrc/ide/idefile.cpp b/uppsrc/ide/idefile.cpp index 4fade77ef..83420d954 100644 --- a/uppsrc/ide/idefile.cpp +++ b/uppsrc/ide/idefile.cpp @@ -582,10 +582,10 @@ void Ide::TriggerAssistSync() void Ide::EditAsHex() { String path = editfile; - if(editashex.Find(path) >= 0) - return; - editastext.RemoveKey(path); - editashex.FindPut(path); + if(editashex.Find(path) >= 0) + return; + editastext.RemoveKey(editfile); + editashex.FindPut(editfile); byte cs = editor.GetCharset(); FlushFile(); EditFile0(path, cs); @@ -608,6 +608,8 @@ void Ide::DoEditAsText(const String& path) void Ide::EditAsText() { String path = editfile; + if(editastext.Find(path) >= 0) + return; if(!FileExists(path)) return; DoEditAsText(path); @@ -619,6 +621,8 @@ void Ide::EditAsText() void Ide::EditUsingDesigner() { String path = editfile; + if (editastext.Find(editfile) < 0 && editashex.Find(editfile) < 0) + return; editashex.RemoveKey(editfile); editastext.RemoveKey(editfile); byte cs = editor.GetCharset();