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

Method setupEditor

src/EditorManager.cpp:178–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178void EditorManager::setupEditor(ScintillaNext *editor)
179{
180 qInfo(Q_FUNC_INFO);
181
182 editor->clearCmdKey(SCK_INSERT);
183
184 editor->setFoldMarkers(QStringLiteral("box"));
185 for (int i = SC_MARKNUM_FOLDEREND; i <= SC_MARKNUM_FOLDEROPEN; ++i) {
186 editor->markerSetFore(i, 0xF3F3F3);
187 editor->markerSetBack(i, 0x808080);
188 editor->markerSetBackSelected(i, 0x0000FF);
189 }
190
191 editor->setIdleStyling(SC_IDLESTYLING_TOVISIBLE);
192 editor->setEndAtLastLine(false);
193
194 editor->setMultipleSelection(true);
195 editor->setAdditionalSelectionTyping(true);
196 editor->setMultiPaste(SC_MULTIPASTE_EACH);
197 editor->setVirtualSpaceOptions(SCVS_RECTANGULARSELECTION);
198
199 editor->setMarginLeft(2);
200
201 editor->setMarginWidthN(0, 30);
202 editor->setMarginMaskN(1, (1<<MARK_HIDELINESBEGIN) | (1<<MARK_HIDELINESEND) | (1<<MARK_HIDELINESUNDERLINE));
203 editor->setMarginMaskN(2, SC_MASK_FOLDERS);
204 editor->setMarginWidthN(2, 14);
205
206 editor->markerDefine(MARK_HIDELINESUNDERLINE, SC_MARK_UNDERLINE);
207 editor->markerSetBack(MARK_HIDELINESUNDERLINE, 0x77CC77);
208
209 editor->markerDefine(MARK_HIDELINESBEGIN, SC_MARK_ARROW);
210 editor->markerDefine(MARK_HIDELINESEND, SC_MARK_ARROWDOWN);
211
212 editor->setMarginSensitiveN(2, true);
213
214 editor->setFoldFlags(SC_FOLDFLAG_LINEAFTER_CONTRACTED);
215 editor->setScrollWidthTracking(true);
216 editor->setScrollWidth(1);
217
218 editor->setTabDrawMode(SCTD_STRIKEOUT);
219 editor->setTabWidth(4);
220 editor->setBackSpaceUnIndents(true);
221
222 editor->setCaretLineVisible(true);
223 editor->setCaretLineVisibleAlways(true);
224 editor->setCaretWidth(2);
225
226 editor->setEdgeColour(0x80FFFF);
227
228 // https://www.scintilla.org/ScintillaDoc.html#ElementColours
229 // SC_ELEMENT_SELECTION_TEXT
230 // SC_ELEMENT_SELECTION_BACK
231 // SC_ELEMENT_SELECTION_ADDITIONAL_TEXT
232 // SC_ELEMENT_SELECTION_ADDITIONAL_BACK
233 // SC_ELEMENT_SELECTION_SECONDARY_TEXT
234 // SC_ELEMENT_SELECTION_SECONDARY_BACK
235 // SC_ELEMENT_SELECTION_INACTIVE_TEXT

Callers

nothing calls this directly

Calls 4

setFoldMarkersMethod · 0.80
isEmptyMethod · 0.80
dataMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected