| 3012 | } |
| 3013 | |
| 3014 | void 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 | |
| 3032 | void ScintillaEditView::insertNewLineBelowCurrentLine(bool) |
| 3033 | { |
no test coverage detected