1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +00:00

HackStudio: Migrate git-diff indicators to TextEditor API

As part of this, the CodeDocument now keeps track of the kind of
difference for each line. Previously, we iterated every hunk every time
the editor was painted, but now we do that once whenever the diff
changes, and then save the type of difference for each line.
This commit is contained in:
Sam Atkins 2023-03-15 11:33:18 +00:00 committed by Andreas Kling
parent 620bf45f43
commit 0761926127
5 changed files with 84 additions and 31 deletions

View file

@ -87,8 +87,10 @@ void EditorWrapper::save()
void EditorWrapper::update_diff()
{
if (m_git_repo)
if (m_git_repo) {
m_hunks = Diff::parse_hunks(m_git_repo->unstaged_diff(filename()).value());
editor().update_git_diff_indicators().release_value_but_fixme_should_propagate_errors();
}
}
void EditorWrapper::set_project_root(DeprecatedString const& project_root)