mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 14:45:07 +00:00
HackStudio: Support opening the same file in both editors
Hey, it actually works! You can now edit the same file in both editors and even the C++ highlighting updates correctly in both of them. :^)
This commit is contained in:
parent
9b13a3905b
commit
e2d7f585da
5 changed files with 26 additions and 7 deletions
|
@ -2,6 +2,15 @@
|
|||
#include <LibCore/CFile.h>
|
||||
#include <string.h>
|
||||
|
||||
const GTextDocument& TextDocument::document() const
|
||||
{
|
||||
if (!m_document) {
|
||||
m_document = GTextDocument::create(nullptr);
|
||||
m_document->set_text(contents());
|
||||
}
|
||||
return *m_document;
|
||||
}
|
||||
|
||||
const ByteBuffer& TextDocument::contents() const
|
||||
{
|
||||
if (m_contents.is_null()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue