Skip to content

Commit

Permalink
Fixed: honour the "Skip warnings" after build ends
Browse files Browse the repository at this point in the history
    this should close issue: #3552 (along with the previous commit)

Signed-off-by: Eran Ifrah <eran@codelite.org>
  • Loading branch information
eranif committed Dec 26, 2024
1 parent 1517e2e commit 273639e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
24 changes: 17 additions & 7 deletions LiteEditor/BuildTabView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ void BuildTabView::OnNextBuildError(wxCommandEvent& event)
++from;
}
clDEBUG() << "searching error from line:" << from << endl;
SelectFirstErrorOrWarning(from, m_jumpThroughErrorsOnly);
SelectFirstErrorOrWarning(from, m_onlyErrors);
}

void BuildTabView::OnNextBuildErrorUI(wxUpdateUIEvent& event) { event.Enable(m_warnCount || m_errorCount); }
Expand Down Expand Up @@ -392,14 +392,24 @@ BuildTabView::GetNextLineWithErrorOrWarning(size_t from, bool errors_only) const
clDEBUG() << "Empty line info" << endl;
return {};
}

auto iter = m_lineInfo.lower_bound(from);
if (iter == m_lineInfo.end()) {
clDEBUG() << "Could not find an error / warning info for line >=" << from << endl;
return {};
while (iter != m_lineInfo.end()) {
switch (iter->second->match_pattern.sev) {
case Compiler::kSevWarning:
case Compiler::kSevNote:
if (errors_only) {
// items are sorted, move forward to the next match
++iter;
continue;
}
// fall through
case Compiler::kSevError:
clDEBUG() << "Found:" << iter->second->message << endl;
return *iter;
}
}

clDEBUG() << "Found:" << iter->second->message << endl;
return *iter;
return {};
}

void BuildTabView::ClearLineMarker() { MarkerDeleteAll(LINE_MARKER); }
Expand Down
6 changes: 3 additions & 3 deletions LiteEditor/BuildTabView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class BuildTabView : public wxStyledTextCtrl

/// Initialise the view, preparing it for the next build process. This method should be called when a new build
/// is starting
void Initialise(CompilerPtr compiler, bool jump_through_errors_only)
void Initialise(CompilerPtr compiler, bool only_erros)
{
Clear();
m_activeCompiler = compiler; // maybe null
m_jumpThroughErrorsOnly = jump_through_errors_only;
m_onlyErrors = only_erros;
}

size_t GetErrorCount() const { return m_errorCount; }
Expand All @@ -68,7 +68,7 @@ class BuildTabView : public wxStyledTextCtrl
private:
std::map<size_t, std::shared_ptr<LineClientData>> m_lineInfo;
CompilerPtr m_activeCompiler;
bool m_jumpThroughErrorsOnly = false;
bool m_onlyErrors = false;
size_t m_errorCount = 0;
size_t m_warnCount = 0;
wxString m_currentProject;
Expand Down

0 comments on commit 273639e

Please sign in to comment.