Skip to content

Commit

Permalink
#3485
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Sep 9, 2017
1 parent 2d52beb commit 72cd832
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 30 deletions.
4 changes: 4 additions & 0 deletions far/changelog
@@ -1,3 +1,7 @@
drkns 09.09.2017 17:32:31 +0100 - build 5025

1. 0003485: Exception при попытке просмотра некорректного? hlf

zg 03.09.2017 14:24:00 FLE Daylight Time - build 5024

1. при удалении выделения в неактивном редакторе, он перерисовывался поверх всех окон.
Expand Down
40 changes: 11 additions & 29 deletions far/help.cpp
Expand Up @@ -336,9 +336,8 @@ bool Help::ReadHelp(const string& Mask)
wchar_t DrawLineChar = 0;
const int MaxLength = CanvasWidth();

StartPos = (DWORD)-1;
LastStartPos = (DWORD)-1;
int RealMaxLength;
StartPos = 0;
LastStartPos = 0;
bool MacroProcess=false;
int MI=0;
string strMacroArea;
Expand All @@ -350,10 +349,7 @@ bool Help::ReadHelp(const string& Mask)

for (;;)
{
if (StartPos != (DWORD)-1)
RealMaxLength = MaxLength-StartPos;
else
RealMaxLength = MaxLength;
const int RealMaxLength = MaxLength - StartPos;

if (!MacroProcess && !RepeatLastLine && !BreakProcess)
{
Expand Down Expand Up @@ -561,8 +557,8 @@ bool Help::ReadHelp(const string& Mask)
*/
if (NearTopicFound)
{
StartPos = (DWORD)-1;
LastStartPos = (DWORD)-1;
StartPos = 0;
LastStartPos = 0;
}

if ((!strReadStr.empty() && strReadStr[0]==L'$') && NearTopicFound && (PrevSymbol == L'$' || PrevSymbol == L'@'))
Expand All @@ -586,8 +582,8 @@ bool Help::ReadHelp(const string& Mask)
if (StringLen(strReadStr)<RealMaxLength)
{
AddLine(strReadStr);
LastStartPos = (DWORD)-1;
StartPos = (DWORD)-1;
LastStartPos = 0;
StartPos = 0;
continue;
}
}
Expand Down Expand Up @@ -616,7 +612,7 @@ bool Help::ReadHelp(const string& Mask)
if (!strSplitLine.empty())
{
AddLine(strSplitLine);
StartPos = (DWORD)-1;
StartPos = 0;
}

for (size_t nl = strReadStr.find(L'\n'); nl != string::npos; )
Expand All @@ -640,7 +636,7 @@ bool Help::ReadHelp(const string& Mask)
if (!strSplitLine.empty())
{
AddLine(strSplitLine);
StartPos = (DWORD)-1;
StartPos = 0;
}
wchar_t userSeparator[4] = { L' ', (DrawLineChar ? DrawLineChar : BoxSymbols[BS_H1]), L' ', 0 }; // left-center-right
int Mul = (DrawLineChar == L'@' || DrawLineChar == L'~' || DrawLineChar == L'#' ? 2 : 1); // Double. See Help::OutString
Expand Down Expand Up @@ -740,22 +736,8 @@ bool Help::ReadHelp(const string& Mask)

void Help::AddLine(const string& Line)
{
string strLine;

if (StartPos != 0xFFFFFFFF)
{
DWORD StartPos0=StartPos;
if (!Line.empty() && Line[0] == L' ')
StartPos0--;

if (StartPos0 > 0)
{
strLine.assign(StartPos0, L' ');
}
}

strLine += Line;
HelpList.emplace_back(strLine);
const auto Width = StartPos && !Line.empty() && Line[0] == L' '? StartPos - 1 : StartPos;
HelpList.emplace_back(string(Width, L' ') + Line);
}

void Help::AddTitle(const string& Title)
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,5024)m4_dnl
m4_define(BUILD,5025)m4_dnl

0 comments on commit 72cd832

Please sign in to comment.