MdTab: remove the duplication check when current header change

This commit is contained in:
Le Tan 2018-08-24 20:14:04 +08:00
parent b0cd013988
commit 33c1229fb5

View File

@ -182,15 +182,6 @@ bool VMdTab::scrollEditorToHeader(const VHeaderPointer &p_header)
}
}
// If the cursor are now under the right title, we should not change it right at
// the title.
int curBlockNumber = mdEdit->textCursor().block().blockNumber();
if (m_outline.indexOfItemByBlockNumber(curBlockNumber)
== m_outline.indexOfItemByBlockNumber(blockNumber)) {
m_currentHeader = p_header;
return true;
}
if (mdEdit->scrollToHeader(blockNumber)) {
m_currentHeader = p_header;
return true;