summaryrefslogtreecommitdiff
path: root/Userland/DevTools/HackStudio/EditorWrapper.h
diff options
context:
space:
mode:
authorDmitrii Ubskii <ubskydm@gmail.com>2021-06-12 07:07:18 +0300
committerLinus Groh <mail@linusgroh.de>2021-06-13 12:33:15 +0100
commitd5828dbecbba71cb828dc495f35a759792b5f817 (patch)
tree7dc9c5f1fa445cda7d9dcff80216efcb0eb74e5e /Userland/DevTools/HackStudio/EditorWrapper.h
parent8501617fcb750bc8f540dc524faf47ce5b5961c9 (diff)
downloadserenity-d5828dbecbba71cb828dc495f35a759792b5f817.zip
HackStudio: Indicate git changes in the editor's gutter
"+" for added lines, "!" for changed, "-" for removed.
Diffstat (limited to 'Userland/DevTools/HackStudio/EditorWrapper.h')
-rw-r--r--Userland/DevTools/HackStudio/EditorWrapper.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/Userland/DevTools/HackStudio/EditorWrapper.h b/Userland/DevTools/HackStudio/EditorWrapper.h
index 5493be746e..27851485b8 100644
--- a/Userland/DevTools/HackStudio/EditorWrapper.h
+++ b/Userland/DevTools/HackStudio/EditorWrapper.h
@@ -7,9 +7,12 @@
#pragma once
#include "Debugger/BreakpointCallback.h"
+#include "Git/GitRepo.h"
#include "LanguageClient.h"
#include <AK/Function.h>
+#include <AK/RefPtr.h>
#include <AK/Vector.h>
+#include <LibDiff/Hunks.h>
#include <LibGUI/Widget.h>
#include <string.h>
@@ -40,6 +43,14 @@ public:
const String& filename() const { return m_filename; }
bool document_dirty() const { return m_document_dirty; }
+ LexicalPath const& project_root() const { return m_project_root; }
+ void set_project_root(LexicalPath const& project_root);
+
+ GitRepo const* git_repo() const { return m_git_repo; }
+
+ void update_diff();
+ Vector<Diff::Hunk> const& hunks() const { return m_hunks; }
+
private:
EditorWrapper();
@@ -50,6 +61,10 @@ private:
RefPtr<GUI::Label> m_cursor_label;
RefPtr<Editor> m_editor;
bool m_document_dirty { false };
+
+ LexicalPath m_project_root;
+ RefPtr<GitRepo> m_git_repo;
+ Vector<Diff::Hunk> m_hunks;
};
}