Fix EOL symbol color/appearence being reset while changing encoding issue

Fix #13728, close #13763
This commit is contained in:
ozone10 2023-06-10 18:11:32 +02:00 committed by Don Ho
parent fadc083051
commit da8e48f67a
2 changed files with 21 additions and 9 deletions

View File

@ -2882,6 +2882,10 @@ void ScintillaEditView::showNpc(bool willBeShowed, bool isSearchResult)
{
setNpcAndCcUniEOL();
}
// in some case npc representation is not redrawn correctly on first line
// therefore use of showEOL(isShownEol()) instead of redraw()
showEOL(isShownEol());
}
else
{
@ -2895,10 +2899,6 @@ void ScintillaEditView::showNpc(bool willBeShowed, bool isSearchResult)
showCcUniEol(svp._ccUniEolShow);
}
// in some case npc representation is not redrawn correctly on first line
// therefore use of showEOL(isShownEol()) instead of redraw()
showEOL(isShownEol());
}
void ScintillaEditView::showCcUniEol(bool willBeShowed, bool isSearchResult)
@ -2937,6 +2937,7 @@ void ScintillaEditView::showCcUniEol(bool willBeShowed, bool isSearchResult)
if (svp._npcShow)
{
showNpc();
return; // showEOL(isShownEol()) already in showNpc()
}
}

View File

@ -497,15 +497,26 @@ public:
void maintainStateForNpc() {
const auto& svp = NppParameters::getInstance().getSVP();
const bool isShownNpc = svp._npcShow;
const bool isNpcIncCcUniEol = svp._npcIncludeCcUniEol;
const bool isShownCcUniEol = svp._ccUniEolShow;
if (isShownNpc || isNpcIncCcUniEol)
if (isShownNpc && isShownCcUniEol)
{
showNpc(isShownNpc);
}
showNpc(true);
showCcUniEol(true);
showCcUniEol(isShownCcUniEol);
if (svp._eolMode != svp.roundedRectangleText)
{
setCRLF();
}
}
else if (!isShownNpc && isShownCcUniEol)
{
showNpc(false);
}
else
{
showCcUniEol(false);
}
}
void showCcUniEol(bool willBeShowed = true, bool isSearchResult = false);