Skip to content

Commit

Permalink
golangast symbol fix save histroy
Browse files Browse the repository at this point in the history
  • Loading branch information
visualfc committed Jul 5, 2016
1 parent fe41abd commit 61ec4f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions liteidex/src/plugins/golangast/golangsymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ QModelIndex GolangSymbol::filterChanged(const QString &text)
return m_proxy->index(0,0);
}

bool GolangSymbol::gotoIndex(const QModelIndex &index)
bool GolangSymbol::gotoIndex(const QModelIndex &index,bool saveHistroy)
{
QModelIndex i = m_proxy->mapToSource(index);
if (!i.isValid()) {
Expand All @@ -125,18 +125,18 @@ bool GolangSymbol::gotoIndex(const QModelIndex &index)
}
AstItemPos pos = item->m_posList.at(0);
QFileInfo info(QDir(m_process->workingDirectory()),pos.fileName);
LiteApi::gotoLine(m_liteApp,info.filePath(),pos.line-1,pos.column-1,true,true);
LiteApi::gotoLine(m_liteApp,info.filePath(),pos.line-1,pos.column-1,true,saveHistroy);
return true;
}

void GolangSymbol::indexChanged(const QModelIndex &index)
{
gotoIndex(index);
gotoIndex(index,false);
}

bool GolangSymbol::selected(const QString &/*text*/, const QModelIndex &index)
{
return gotoIndex(index);
return gotoIndex(index,true);
}

void GolangSymbol::finished(int code, QProcess::ExitStatus status)
Expand Down
2 changes: 1 addition & 1 deletion liteidex/src/plugins/golangast/golangsymbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class GolangSymbol : public LiteApi::IQuickOpen
virtual QModelIndex filterChanged(const QString &text);
virtual void indexChanged(const QModelIndex &index);
virtual bool selected(const QString &text, const QModelIndex &index);
bool gotoIndex(const QModelIndex &index);
bool gotoIndex(const QModelIndex &index, bool saveHistroy);
public slots:
void finished(int code,QProcess::ExitStatus status);
protected:
Expand Down

0 comments on commit 61ec4f8

Please sign in to comment.