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

Method LinesSplit

scintilla/src/Editor.cxx:1798–1826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1796}
1797
1798void Editor::LinesSplit ( int pixelWidth )
1799{
1800 if ( !RangeContainsProtected ( targetStart, targetEnd ) ) {
1801 if ( pixelWidth == 0 ) {
1802 PRectangle rcText = GetTextRectangle();
1803 pixelWidth = rcText.Width();
1804 }
1805 int lineStart = pdoc->LineFromPosition ( targetStart );
1806 int lineEnd = pdoc->LineFromPosition ( targetEnd );
1807 const char *eol = StringFromEOLMode ( pdoc->eolMode );
1808 UndoGroup ug ( pdoc );
1809 for ( int line = lineStart; line <= lineEnd; line++ ) {
1810 AutoSurface surface ( this );
1811 AutoLineLayout ll ( llc, RetrieveLineLayout ( line ) );
1812 if ( surface && ll ) {
1813 unsigned int posLineStart = pdoc->LineStart ( line );
1814 LayoutLine ( line, surface, vs, ll, pixelWidth );
1815 for ( int subLine = 1; subLine < ll->lines; subLine++ ) {
1816 pdoc->InsertCString (
1817 static_cast<int> ( posLineStart + ( subLine - 1 ) * strlen ( eol ) +
1818 ll->LineStart ( subLine ) ),
1819 eol );
1820 targetEnd += static_cast<int> ( strlen ( eol ) );
1821 }
1822 }
1823 lineEnd = pdoc->LineFromPosition ( targetEnd );
1824 }
1825 }
1826}
1827
1828int Editor::SubstituteMarkerIfEmpty ( int markerCheck, int markerDefault )
1829{

Callers

nothing calls this directly

Calls 4

WidthMethod · 0.80
InsertCStringMethod · 0.80
LineFromPositionMethod · 0.45
LineStartMethod · 0.45

Tested by

no test coverage detected