Skip to content

Commit eda1523

Browse files
author
Eugen Kremer
committed
restore semi old version of clearindicators
1 parent e4d7d72 commit eda1523

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

editor/view/IndicatorPanel.cpp

+16-5
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,21 @@ void IndicatorPanel::OnUpdateLines()
9292
}
9393
}
9494

95-
void IndicatorPanel::EraseIndicatorLines(int begin, int end)
95+
void IndicatorPanel::ClearIndicators(int begin, int end)
9696
{
97-
auto beginViewPos = m_View.sci(SCI_VISIBLEFROMDOCLINE, begin, 0);
98-
auto endViewPos = m_View.sci(SCI_VISIBLEFROMDOCLINE, end, 0);
97+
if (m_Indicators.empty())
98+
return;
99+
100+
// document line
101+
unsigned int beginLine = (begin <= 0) ? 0 : m_View.sci(SCI_LINEFROMPOSITION, begin, 0);
102+
unsigned int endLine = (end < 0) ? m_View.sci(SCI_GETLINECOUNT, 0, 0) : m_View.sci(SCI_LINEFROMPOSITION, end, 0);
103+
104+
// view line
105+
auto beginViewPos = m_View.sci(SCI_VISIBLEFROMDOCLINE, beginLine, 0);
106+
auto endViewPos = m_View.sci(SCI_VISIBLEFROMDOCLINE, endLine, 0);
107+
108+
if (end < 0)
109+
endViewPos = max(endViewPos, m_Indicators.rbegin()->first);
99110

100111
m_Indicators.erase(
101112
m_Indicators.emplace(beginViewPos, 0).first,
@@ -107,14 +118,14 @@ bool IndicatorPanel::GetIndicatorLines() {
107118

108119
auto stopTime = GetTickCount64() + 200; // 200ms
109120

121+
ClearIndicators(m_Begin, m_End);
122+
110123
if (m_Begin < 0)
111124
m_Begin = 0;
112125

113126
if (m_End < 0)
114127
m_End = m_View.sci(SCI_GETLENGTH, 0, 0);
115128

116-
EraseIndicatorLines(m_Begin, m_End);
117-
118129
auto line = m_View.sci(SCI_LINEFROMPOSITION, m_Begin, 0);
119130
auto lineEnd = m_View.sci(SCI_GETLINEENDPOSITION, line, 0);
120131
auto nextSavePosition = min(lineEnd, m_End - 1);

editor/view/IndicatorPanel.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class IndicatorPanel
6363
void OnUpdatePixels();
6464
void OnUpdateLines();
6565

66-
void EraseIndicatorLines(int begin, int end);
66+
void ClearIndicators(int begin, int end);
6767
bool GetIndicatorLines();
6868
void GetIndicatorPixels();
6969

jN.vcxproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<VersionMinor>0</VersionMinor>
2727
<BuildNumber>0</BuildNumber>
2828
<VersionRevision>0</VersionRevision>
29+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2930
</PropertyGroup>
3031
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
3132
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
@@ -41,7 +42,7 @@
4142
<PlatformToolset>v142</PlatformToolset>
4243
</PropertyGroup>
4344
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
44-
<PlatformToolset>v142</PlatformToolset>
45+
<PlatformToolset>v143</PlatformToolset>
4546
</PropertyGroup>
4647
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
4748
<PlatformToolset>v142</PlatformToolset>

0 commit comments

Comments
 (0)