MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / ClearSelection

Method ClearSelection

scintilla/src/Editor.cxx:4232–4251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4230}
4231
4232void Editor::ClearSelection ( bool retainMultipleSelections )
4233{
4234 if ( !sel.IsRectangular() && !retainMultipleSelections ) {
4235 FilterSelections();
4236 }
4237 UndoGroup ug ( pdoc );
4238 for ( size_t r = 0; r < sel.Count(); r++ ) {
4239 if ( !sel.Range ( r ).Empty() ) {
4240 if ( !RangeContainsProtected ( sel.Range ( r ).Start().Position(),
4241 sel.Range ( r ).End().Position() ) ) {
4242 pdoc->DeleteChars ( sel.Range ( r ).Start().Position(),
4243 sel.Range ( r ).Length() );
4244 sel.Range ( r ) = sel.Range ( r ).Start();
4245 }
4246 }
4247 }
4248 ThinRectangularRange();
4249 sel.RemoveDuplicates();
4250 ClaimSelection();
4251}
4252
4253void Editor::ClearAll()
4254{

Callers

nothing calls this directly

Calls 10

IsRectangularMethod · 0.80
RangeMethod · 0.80
PositionMethod · 0.80
RemoveDuplicatesMethod · 0.80
CountMethod · 0.45
EmptyMethod · 0.45
StartMethod · 0.45
EndMethod · 0.45
DeleteCharsMethod · 0.45
LengthMethod · 0.45

Tested by

no test coverage detected