logic: scroll code when no symbol
Scrolling to line, when comming from plugin and the file is was modified. Since there we dont know from the position data if the symbol on position is the right one, we scroll to the line if modified.
This commit is contained in:
@@ -25,6 +25,7 @@ QtCodeView::QtCodeView(ViewLayout* viewLayout)
|
||||
, m_defocusTokenIdsFunctor(std::bind(&QtCodeView::doDefocusTokenIds, this))
|
||||
, m_showContentsFunctor(std::bind(&QtCodeView::doShowContents, this))
|
||||
, m_scrollToValueFunctor(std::bind(&QtCodeView::doScrollToValue, this, std::placeholders::_1))
|
||||
, m_scrollToLineFunctor(std::bind(&QtCodeView::doScrollToLine, this, std::placeholders::_1, std::placeholders::_2))
|
||||
{
|
||||
m_widget = new QtCodeFileList();
|
||||
setStyleSheet();
|
||||
@@ -121,6 +122,11 @@ void QtCodeView::scrollToValue(int value)
|
||||
m_scrollToValueFunctor(value);
|
||||
}
|
||||
|
||||
void QtCodeView::scrollToLine(std::string filename, unsigned int line)
|
||||
{
|
||||
m_scrollToLineFunctor(filename, line);
|
||||
}
|
||||
|
||||
void QtCodeView::doRefreshView()
|
||||
{
|
||||
setStyleSheet();
|
||||
@@ -232,6 +238,11 @@ void QtCodeView::doScrollToValue(int value)
|
||||
m_widget->scrollToValue(value);
|
||||
}
|
||||
|
||||
void QtCodeView::doScrollToLine(std::string filename, unsigned int line)
|
||||
{
|
||||
m_widget->scrollToLine(filename, line);
|
||||
}
|
||||
|
||||
void QtCodeView::setStyleSheet() const
|
||||
{
|
||||
utility::setWidgetBackgroundColor(m_widget, ColorScheme::getInstance()->getColor("code/background"));
|
||||
|
||||
Reference in New Issue
Block a user