| 47 | } |
| 48 | |
| 49 | void ScintillaCommenter::toggleLine(int line) |
| 50 | { |
| 51 | auto indentPos = editor->lineIndentPosition(line); |
| 52 | auto lineEnd = qMin(indentPos + editor->languageSingleLineComment.length(), editor->lineEndPosition(line)); |
| 53 | const QByteArray commentText = editor->get_text_range(indentPos, lineEnd); |
| 54 | |
| 55 | if (commentText == editor->languageSingleLineComment) { |
| 56 | editor->deleteRange(indentPos, editor->languageSingleLineComment.length()); |
| 57 | |
| 58 | st.trackDeletion(indentPos, editor->languageSingleLineComment.length()); |
| 59 | } |
| 60 | else { |
| 61 | if (indentPos == editor->lineEndPosition(line)) { |
| 62 | return; |
| 63 | } |
| 64 | |
| 65 | editor->insertText(indentPos, editor->languageSingleLineComment.constData()); |
| 66 | |
| 67 | st.trackInsertion(indentPos, editor->languageSingleLineComment.length()); |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | void ScintillaCommenter::commentLine(int line) |
| 72 | { |
nothing calls this directly
no test coverage detected