mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 14:05:15 +00:00
This fixes the bug seen in my monthly OS update video, where we'd look through a stale copy of each file, instead of the potentially edited version in the GTextDocument. Search results are now also represented as a full GTextRange, and when you jump to a search result, we select the whole matching range. :^)
28 lines
607 B
C++
28 lines
607 B
C++
#pragma once
|
|
|
|
#include <AK/ByteBuffer.h>
|
|
#include <AK/NonnullRefPtr.h>
|
|
#include <AK/RefCounted.h>
|
|
#include <AK/String.h>
|
|
#include <LibGUI/GTextDocument.h>
|
|
|
|
class ProjectFile : public RefCounted<ProjectFile> {
|
|
public:
|
|
static NonnullRefPtr<ProjectFile> construct_with_name(const String& name)
|
|
{
|
|
return adopt(*new ProjectFile(name));
|
|
}
|
|
|
|
const String& name() const { return m_name; }
|
|
|
|
const GTextDocument& document() const;
|
|
|
|
private:
|
|
explicit ProjectFile(const String& name)
|
|
: m_name(name)
|
|
{
|
|
}
|
|
|
|
String m_name;
|
|
mutable RefPtr<GTextDocument> m_document;
|
|
};
|