fix: Dirty projects on load. (#2649)

When a project is loaded it is set to dirty without any changes so that
it goes through the steps that patterns with changes go through. The fix
uses a different starting step that doesn't set the dirty flags when
changing providers or loading projects.
This commit is contained in:
paxcut
2026-02-09 20:21:51 -07:00
committed by GitHub
parent a5008722aa
commit 800a24b42e
5 changed files with 23 additions and 42 deletions

View File

@@ -68,7 +68,7 @@ namespace hex::plugin::builtin {
}
void TextHighlighter::next(i32 count) {
if (m_viewPatternEditor->wasInterrupted()) {
if (m_viewPatternEditor->interrupted()) {
m_viewPatternEditor->resetInterrupt();
throw std::out_of_range("Highlights were deliberately interrupted");
}
@@ -2510,7 +2510,7 @@ namespace hex::plugin::builtin {
m_viewPatternEditor->resetInterrupt();
ON_SCOPE_EXIT {
m_viewPatternEditor->incrementRunningHighlighters(-1);
m_viewPatternEditor->setChangesWereColored(!m_viewPatternEditor->wasInterrupted());
m_viewPatternEditor->setChangesWereColored(!m_viewPatternEditor->interrupted());
};
try {
m_viewPatternEditor->incrementRunningHighlighters(1);
@@ -2556,7 +2556,7 @@ namespace hex::plugin::builtin {
}
} catch (const std::out_of_range &e) {
log::debug("TextHighlighter::highlightSourceCode: Out of range error: {}", e.what());
m_viewPatternEditor->setWasInterrupted(true);
m_viewPatternEditor->interrupt();
return;
}