diff options
Diffstat (limited to 'src/plugins/bookmarks/bookmarksplugin.cpp')
-rw-r--r-- | src/plugins/bookmarks/bookmarksplugin.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp index 2f25571b538..7473876ec63 100644 --- a/src/plugins/bookmarks/bookmarksplugin.cpp +++ b/src/plugins/bookmarks/bookmarksplugin.cpp @@ -128,14 +128,16 @@ BookmarksPluginPrivate::BookmarksPluginPrivate() mbm->addAction(cmd); connect(&m_toggleAction, &QAction::triggered, this, [this] { - BaseTextEditor *editor = BaseTextEditor::currentTextEditor(); - if (editor && !editor->document()->isTemporary()) + IEditor *editor = EditorManager::currentEditor(); + auto widget = TextEditorWidget::fromEditor(editor); + if (widget && editor && !editor->document()->isTemporary()) m_bookmarkManager.toggleBookmark(editor->document()->filePath(), editor->currentLine()); }); connect(&m_editAction, &QAction::triggered, this, [this] { - BaseTextEditor *editor = BaseTextEditor::currentTextEditor(); - if (editor && !editor->document()->isTemporary()) { + IEditor *editor = EditorManager::currentEditor(); + auto widget = TextEditorWidget::fromEditor(editor); + if (widget && editor && !editor->document()->isTemporary()) { const FilePath filePath = editor->document()->filePath(); const int line = editor->currentLine(); if (!m_bookmarkManager.hasBookmarkInPosition(filePath, line)) |