diff options
-rw-r--r-- | src/plugins/bookmarks/bookmarkmanager.cpp | 9 | ||||
-rw-r--r-- | src/plugins/texteditor/basetextmark.cpp | 7 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index 4fc8c04010..116e732271 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -485,11 +485,10 @@ Bookmark *BookmarkManager::bookmarkForIndex(QModelIndex index) bool BookmarkManager::gotoBookmark(Bookmark* bookmark) { - if (!TextEditor::BaseTextEditor::openEditorAt(bookmark->filePath(), bookmark->lineNumber())) { - // Could not open editor - return false; - } - return true; + using namespace TextEditor; + if (ITextEditor *editor = BaseTextEditor::openEditorAt(bookmark->filePath(), bookmark->lineNumber())) + return (editor->currentLine() == bookmark->lineNumber()); + return false; } void BookmarkManager::nextInDocument() diff --git a/src/plugins/texteditor/basetextmark.cpp b/src/plugins/texteditor/basetextmark.cpp index 0d50a7111e..cc64f152bf 100644 --- a/src/plugins/texteditor/basetextmark.cpp +++ b/src/plugins/texteditor/basetextmark.cpp @@ -72,7 +72,12 @@ void BaseTextMark::editorOpened(Core::IEditor *editor) if (m_markableInterface == 0) { // We aren't added to something m_markableInterface = textEditor->markableInterface(); m_internalMark = new InternalMark(this); - m_markableInterface->addMark(m_internalMark, m_line); + + if (!m_markableInterface->addMark(m_internalMark, m_line)) { + delete m_internalMark; + m_internalMark = 0; + m_markableInterface = 0; + } } } } |