Skip to content

Commit

Permalink
1. при сохранении файла в редакторе текущей устанавливалась папка, в …
Browse files Browse the repository at this point in the history
…которой редактор был запущен.

   убрано.
  • Loading branch information
zg0 committed Sep 23, 2017
1 parent 7061b70 commit feaf0b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 29 deletions.
5 changes: 5 additions & 0 deletions far/changelog
@@ -1,3 +1,8 @@
zg 23.09.2017 15:25:28 FLE Daylight Time - build 5037

1. при сохранении файла в редакторе текущей устанавливалась папка, в которой редактор был запущен.
убрано.

drkns 21.09.2017 21:43:58 +0100 - build 5036

1. 0003499: При запуске из панели в командной строке отображается избыточный полный путь к файлу
Expand Down
28 changes: 0 additions & 28 deletions far/fileedit.cpp
Expand Up @@ -1002,7 +1002,6 @@ bool FileEditor::ReProcessKey(const Manager::Key& Key, bool CalledFromControl)
case KEY_SHIFTF2:
{
auto Done = false;
const auto strOldCurDir = os::GetCurrentDirectory();
while (!Done) // бьемся до упора
{
// проверим путь к файлу, может его уже снесли...
Expand Down Expand Up @@ -1043,38 +1042,17 @@ bool FileEditor::ReProcessKey(const Manager::Key& Key, bool CalledFromControl)
strSaveAsName = unquote(os::env::expand(strSaveAsName));
const auto NameChanged = !equal_icase(strSaveAsName, m_Flags.Check(FFILEEDIT_SAVETOSAVEAS)? strFullFileName : strFileName);

if (!NameChanged)
FarChDir(strStartDir); // ПОЧЕМУ? А нужно ли???

if (NameChanged)
{
if (!AskOverwrite(strSaveAsName))
{
FarChDir(strOldCurDir);
return true;
}
}

strFullSaveAsName = ConvertNameToFull(strSaveAsName); //BUGBUG, не проверяем имя на правильность
//это не про нас, про нас ниже, все куда страшнее
/*string strFileNameTemp = strSaveAsName;
if(!SetFileName(strFileNameTemp))
{
SetLastError(ERROR_INVALID_NAME);
Global->CatchError();
Message(MSG_WARNING|MSG_ERRORTYPE,1,msg(lng::MEditTitle),strFileNameTemp,msg(lng::MOk));
if(!NameChanged)
FarChDir(strOldCurDir);
continue;
//return false;
} */

if (!NameChanged)
FarChDir(strOldCurDir);
}

FarChDir(strStartDir); //???
int SaveResult=SaveFile(strFullSaveAsName, 0, SaveAs, TextFormat, codepage, m_bAddSignature);

if (SaveResult==SAVEFILE_ERROR)
Expand Down Expand Up @@ -1419,11 +1397,8 @@ int FileEditor::SetCodePage(uintptr_t cp, bool redetect_default, bool ascii2def)

int FileEditor::ProcessQuitKey(int FirstSave, bool NeedQuestion, bool DeleteWindow)
{
const auto strOldCurDir = os::GetCurrentDirectory();

for (;;)
{
FarChDir(strStartDir); // ПОЧЕМУ? А нужно ли???
int SaveCode=SAVEFILE_SUCCESS;

if (NeedQuestion)
Expand Down Expand Up @@ -1458,7 +1433,6 @@ int FileEditor::ProcessQuitKey(int FirstSave, bool NeedQuestion, bool DeleteWind
{
if (!ProcessKey(Manager::Key(KEY_SHIFTF2)))
{
FarChDir(strOldCurDir);
return FALSE;
}
else
Expand All @@ -1470,8 +1444,6 @@ int FileEditor::ProcessQuitKey(int FirstSave, bool NeedQuestion, bool DeleteWind

FirstSave=0;
}

FarChDir(strOldCurDir);
return GetExitCode() == XC_QUIT;
}

Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,5036)m4_dnl
m4_define(BUILD,5037)m4_dnl

0 comments on commit feaf0b6

Please sign in to comment.