| 3030 | } |
| 3031 | |
| 3032 | void ScintillaEditView::insertNewLineBelowCurrentLine(bool) |
| 3033 | { |
| 3034 | QString newline = getEOLString(); |
| 3035 | const auto line_count = execute(SCI_GETLINECOUNT); |
| 3036 | const auto current_line = getCurrentLineNumber(); |
| 3037 | if (current_line == line_count - 1) |
| 3038 | { |
| 3039 | // Special handling if caret is at last line. |
| 3040 | appandGenericText(newline.toUtf8()); |
| 3041 | } |
| 3042 | else |
| 3043 | { |
| 3044 | const auto eol_length = newline.length(); |
| 3045 | const auto position = eol_length + execute(SCI_GETLINEENDPOSITION, current_line); |
| 3046 | insertCharsFrom(position, newline.toUtf8()); |
| 3047 | } |
| 3048 | execute(SCI_SETEMPTYSELECTION, execute(SCI_POSITIONFROMLINE, current_line + 1)); |
| 3049 | } |
| 3050 | |
| 3051 | void ScintillaEditView::sortLines(size_t fromLine, size_t toLine, ISorter* pSort) |
| 3052 | { |
no test coverage detected