MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / updateSelectionInfo

Method updateSelectionInfo

src/widgets/EditorInfoStatusBar.cpp:104–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void 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
127void EditorInfoStatusBar::updateLanguage(ScintillaNext *editor)
128{

Callers

nothing calls this directly

Calls 1

setTextMethod · 0.80

Tested by

no test coverage detected