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

HackStudio: Use GTextDoument::find_all() to implement find-in-files

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. :^)
This commit is contained in:
Andreas Kling 2019-11-01 19:22:42 +01:00
parent b8bf998b61
commit 390b219cd1
3 changed files with 24 additions and 62 deletions

View file

@ -15,10 +15,6 @@ public:
const String& name() const { return m_name; }
const ByteBuffer& contents() const;
Vector<int> find(const StringView&) const;
const GTextDocument& document() const;
private:
@ -28,6 +24,5 @@ private:
}
String m_name;
mutable ByteBuffer m_contents;
mutable RefPtr<GTextDocument> m_document;
};