mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:08: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:
parent
620bf45f43
commit
0761926127
5 changed files with 84 additions and 31 deletions
|
@ -32,4 +32,14 @@ CodeDocument::CodeDocument(Client* client)
|
|||
{
|
||||
}
|
||||
|
||||
CodeDocument::DiffType CodeDocument::line_difference(size_t line) const
|
||||
{
|
||||
return m_line_differences[line];
|
||||
}
|
||||
|
||||
void CodeDocument::set_line_differences(Badge<HackStudio::Editor>, Vector<HackStudio::CodeDocument::DiffType> line_differences)
|
||||
{
|
||||
m_line_differences = move(line_differences);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue