MCPcopy Create free account
hub / github.com/cxasm/notepad-- / insertNewLineAboveCurrentLine

Method insertNewLineAboveCurrentLine

src/scintillaeditview.cpp:3014–3030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3012}
3013
3014void ScintillaEditView::insertNewLineAboveCurrentLine(bool)
3015{
3016 QString newline = getEOLString();
3017 const auto current_line = getCurrentLineNumber();
3018 if (current_line == 0)
3019 {
3020 // Special handling if caret is at first line.
3021 insertCharsFrom(0, newline.toUtf8());
3022 }
3023 else
3024 {
3025 const auto eol_length = newline.length();
3026 const auto position = execute(SCI_POSITIONFROMLINE, current_line) - eol_length;
3027 insertCharsFrom(position, newline.toUtf8());
3028 }
3029 execute(SCI_SETEMPTYSELECTION, execute(SCI_POSITIONFROMLINE, current_line));
3030}
3031
3032void ScintillaEditView::insertNewLineBelowCurrentLine(bool)
3033{

Callers 1

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected