| 102 | } |
| 103 | |
| 104 | void EditorInfoStatusBar::updateSelectionInfo(ScintillaNext *editor) |
| 105 | { |
| 106 | QString selectionText; |
| 107 | |
| 108 | if (editor->selections() > 1) { |
| 109 | selectionText = tr("Sel: N/A"); |
| 110 | } |
| 111 | else { |
| 112 | int start = editor->selectionStart(); |
| 113 | int end = editor->selectionEnd(); |
| 114 | int lines = editor->lineFromPosition(end) - editor->lineFromPosition(start); |
| 115 | |
| 116 | if (end > start) |
| 117 | lines++; |
| 118 | |
| 119 | selectionText = tr("Sel: %L1 | %L2").arg(editor->countCharacters(start, end)).arg(lines); |
| 120 | } |
| 121 | |
| 122 | const int pos = editor->currentPos(); |
| 123 | QString positionText = tr("Ln: %L1 Col: %L2 ").arg(editor->lineFromPosition(pos) + 1).arg(editor->column(pos) + 1); |
| 124 | docPos->setText(positionText + selectionText); |
| 125 | } |
| 126 | |
| 127 | void EditorInfoStatusBar::updateLanguage(ScintillaNext *editor) |
| 128 | { |