MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / createEditor

Method createEditor

src/plugins/codeeditor/gui/tabwidget.cpp:229–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229TextEditor *TabWidgetPrivate::createEditor(const QString &fileName, QsciDocument *doc)
230{
231 TextEditor *editor = new TextEditor(q);
232 editor->updateLineNumberWidth(false);
233 editor->installEventFilter(q);
234
235 connect(editor, &TextEditor::zoomValueChanged, q, &TabWidget::zoomValueChanged);
236 connect(editor, &TextEditor::cursorRecordChanged, this, &TabWidgetPrivate::onCursorRecordChanged);
237 connect(editor, &TextEditor::requestOpenFiles, this, &TabWidgetPrivate::handleOpenFiles);
238 connect(editor, &TextEditor::cursorPositionChanged, symbolBar, &SymbolBar::updateSymbol);
239 connect(editor, &TextEditor::modificationChanged, tabBar, std::bind(&TabBar::onModificationChanged, tabBar, fileName, std::placeholders::_1));
240
241 if (doc) {
242 editor->openFileWithDocument(fileName, *doc);
243 } else {
244 editor->openFile(fileName);
245 }
246
247 editor->setCursorPosition(0, 0);
248 editorMng.insert(fileName, editor);
249 recentOpenedFiles.prepend(fileName);
250
251 return editor;
252}
253
254TextEditor *TabWidgetPrivate::findEditor(const QString &fileName)
255{

Callers 1

openFileMethod · 0.45

Calls 6

connectFunction · 0.85
updateLineNumberWidthMethod · 0.80
openFileWithDocumentMethod · 0.80
insertMethod · 0.80
openFileMethod · 0.45
setCursorPositionMethod · 0.45

Tested by

no test coverage detected