Skip to content

Commit

Permalink
Merge branch 'master' into GenFileName
Browse files Browse the repository at this point in the history
  • Loading branch information
qlost committed Sep 28, 2023
2 parents b44889c + 6786705 commit a5c50a8
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 82 deletions.
5 changes: 5 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
--------------------------------------------------------------------------------
drkns 2023-09-28 17:14:11+01:00 - build 6196

1. Continue 6185.

--------------------------------------------------------------------------------
drkns 2023-09-24 20:39:46+01:00 - build 6195

Expand Down
51 changes: 1 addition & 50 deletions far/far.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -515,56 +515,7 @@ cl /nologo /c /Fo"$(IntDir)%(Filename)_c++.testobj" /TP api_test.c
<AdditionalInputs>farversion.m4;vbuild.m4;%(AdditionalInputs)</AdditionalInputs>
<Outputs>$(OutDir)%(FileName);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="FarEng.hlf.m4">
<FileType>Document</FileType>
<Message>Compiling %(Identity)...</Message>
<Command>tools\gawk -f scripts\mkhlf.awk %(Identity) | $(M4Cmd) &gt; $(OutDir)%(FileName)</Command>
<AdditionalInputs>farversion.m4;vbuild.m4;%(AdditionalInputs)</AdditionalInputs>
<Outputs>$(OutDir)%(FileName);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="FarRus.hlf.m4">
<FileType>Document</FileType>
<Message>Compiling %(Identity)...</Message>
<Command>tools\gawk -f scripts\mkhlf.awk %(Identity) | $(M4Cmd) &gt; $(OutDir)%(FileName)</Command>
<AdditionalInputs>farversion.m4;vbuild.m4;%(AdditionalInputs)</AdditionalInputs>
<Outputs>$(OutDir)%(FileName);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="FarHun.hlf.m4">
<FileType>Document</FileType>
<Message>Compiling %(Identity)...</Message>
<Command>tools\gawk -f scripts\mkhlf.awk %(Identity) | $(M4Cmd) &gt; $(OutDir)%(FileName)</Command>
<AdditionalInputs>farversion.m4;vbuild.m4;%(AdditionalInputs)</AdditionalInputs>
<Outputs>$(OutDir)%(FileName);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="FarPol.hlf.m4">
<FileType>Document</FileType>
<Message>Compiling %(Identity)...</Message>
<Command>tools\gawk -f scripts\mkhlf.awk %(Identity) | $(M4Cmd) &gt; $(OutDir)%(FileName)</Command>
<AdditionalInputs>farversion.m4;vbuild.m4;%(AdditionalInputs)</AdditionalInputs>
<Outputs>$(OutDir)%(FileName);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="FarGer.hlf.m4">
<FileType>Document</FileType>
<Message>Compiling %(Identity)...</Message>
<Command>tools\gawk -f scripts\mkhlf.awk %(Identity) | $(M4Cmd) &gt; $(OutDir)%(FileName)</Command>
<AdditionalInputs>farversion.m4;vbuild.m4;%(AdditionalInputs)</AdditionalInputs>
<Outputs>$(OutDir)%(FileName);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="FarUkr.hlf.m4">
<FileType>Document</FileType>
<Message>Compiling %(Identity)...</Message>
<Command>tools\gawk -f scripts\mkhlf.awk %(Identity) | $(M4Cmd) &gt; $(OutDir)%(FileName)</Command>
<AdditionalInputs>farversion.m4;vbuild.m4;%(AdditionalInputs)</AdditionalInputs>
<Outputs>$(OutDir)%(FileName);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="FarCze.hlf.m4">
<FileType>Document</FileType>
<Message>Compiling %(Identity)...</Message>
<Command>tools\gawk -f scripts\mkhlf.awk %(Identity) | $(M4Cmd) &gt; $(OutDir)%(FileName)</Command>
<AdditionalInputs>farversion.m4;vbuild.m4;%(AdditionalInputs)</AdditionalInputs>
<Outputs>$(OutDir)%(FileName);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="FarSky.hlf.m4">
<CustomBuild Include="*.hlf.m4">
<FileType>Document</FileType>
<Message>Compiling %(Identity)...</Message>
<Command>tools\gawk -f scripts\mkhlf.awk %(Identity) | $(M4Cmd) &gt; $(OutDir)%(FileName)</Command>
Expand Down
27 changes: 3 additions & 24 deletions far/far.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1226,39 +1226,18 @@
<CustomBuild Include="farcolor.hpp">
<Filter>Header Files</Filter>
</CustomBuild>
<CustomBuild Include="FarEng.hlf.m4">
<Filter>Dependencies</Filter>
</CustomBuild>
<CustomBuild Include="FarGer.hlf.m4">
<Filter>Dependencies</Filter>
</CustomBuild>
<CustomBuild Include="FarHun.hlf.m4">
<Filter>Dependencies</Filter>
</CustomBuild>
<CustomBuild Include="farlang.templ.m4">
<Filter>Dependencies</Filter>
</CustomBuild>
<CustomBuild Include="FarPol.hlf.m4">
<Filter>Dependencies</Filter>
</CustomBuild>
<CustomBuild Include="FarRus.hlf.m4">
<Filter>Dependencies</Filter>
</CustomBuild>
<CustomBuild Include="FarUkr.hlf.m4">
<Filter>Dependencies</Filter>
</CustomBuild>
<CustomBuild Include="FarCze.hlf.m4">
<Filter>Dependencies</Filter>
</CustomBuild>
<CustomBuild Include="FarSky.hlf.m4">
<Filter>Dependencies</Filter>
</CustomBuild>
<CustomBuild Include="farversion.inc.m4">
<Filter>Dependencies</Filter>
</CustomBuild>
<CustomBuild Include="File_id.diz.m4">
<Filter>Dependencies</Filter>
</CustomBuild>
<CustomBuild Include="*.hlf.m4">
<Filter>Dependencies</Filter>
</CustomBuild>
<CustomBuild Include="plugin.hpp">
<Filter>Header Files</Filter>
</CustomBuild>
Expand Down
13 changes: 9 additions & 4 deletions far/fileedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,9 @@ bool FileEditor::ReProcessKey(const Manager::Key& Key, bool CalledFromControl)
if (!m_Flags.Check(FFILEEDIT_ENABLEF6))
break; // отдадим F6 плагинам, если есть запрет на переключение

bool ConfirmSave = true;
// If the file is "new", there is nothing to view yet, so we have to save it first.
const auto NeedSave = m_editor->m_Flags.Check(Editor::FEDITOR_MODIFIED) || m_Flags.Check(FFILEEDIT_NEW);
bool ConfirmSave = !m_Flags.Check(FFILEEDIT_NEW);

if (!m_Flags.Check(FFILEEDIT_NEW) && !os::fs::is_file(strFullFileName))
{
Expand All @@ -968,7 +970,7 @@ bool FileEditor::ReProcessKey(const Manager::Key& Key, bool CalledFromControl)
}
}

if (!ProcessQuitKey(true, ConfirmSave, false))
if (!ProcessQuitKey(NeedSave, ConfirmSave, false))
return false;

const auto delete_on_close =
Expand Down Expand Up @@ -1144,7 +1146,7 @@ bool FileEditor::ReProcessKey(const Manager::Key& Key, bool CalledFromControl)
case KEY_ESC:
case KEY_F10:
{
bool ConfirmSave = true, NeedSave = true;
bool ConfirmSave = true, NeedSave = m_editor->m_Flags.Check(Editor::FEDITOR_MODIFIED);

if (!m_Flags.Check(FFILEEDIT_NEW) && !os::fs::is_file(strFullFileName))
{
Expand Down Expand Up @@ -1333,7 +1335,7 @@ static std::optional<bool> confirm_save()

bool FileEditor::ProcessQuitKey(bool const NeedSave, bool ConfirmSave, bool const DeleteWindow)
{
if (NeedSave && m_editor->m_Flags.Check(Editor::FEDITOR_MODIFIED))
if (NeedSave)
{
bool TrySave = true;

Expand Down Expand Up @@ -1915,6 +1917,9 @@ bool FileEditor::SaveAction(bool const SaveAsIntention)
strFileName :
strFullFileName;

if (strSaveAsName.empty())
strSaveAsName = PointToName(strFullFileName);

if (!dlgSaveFileAs(strSaveAsName, Eol, Codepage, AddSignature))
return false;

Expand Down
6 changes: 3 additions & 3 deletions far/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ constexpr struct
LastError,
LastStatus;
}
pdb_offsets
teb_offsets
{
#ifdef _WIN64
0x68,
Expand All @@ -238,12 +238,12 @@ pdb_offsets

NTSTATUS get_last_nt_status(void const* Teb)
{
return view_as<NTSTATUS>(Teb, pdb_offsets.LastStatus);
return view_as<NTSTATUS>(Teb, teb_offsets.LastStatus);
}

DWORD get_last_error(void const* const Teb)
{
return view_as<DWORD>(Teb, pdb_offsets.LastError);
return view_as<DWORD>(Teb, teb_offsets.LastError);
}

NTSTATUS get_last_nt_status()
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6195
6196

0 comments on commit a5c50a8

Please sign in to comment.