1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 17:55:09 +00:00

TextEditor: Replaced 'Find' button with 'Prev' and 'Next' buttons.

This commit is contained in:
Andrew Weller 2019-08-24 12:09:35 -06:00 committed by Andreas Kling
parent 952baf32cd
commit e75e33eb46
4 changed files with 87 additions and 11 deletions

View file

@ -12,6 +12,7 @@ class GScrollBar;
class Painter;
enum class ShouldWrapAtEndOfDocument { No = 0, Yes };
enum class ShouldWrapAtStartOfDocument { No = 0, Yes };
class GTextPosition {
public:
@ -126,9 +127,12 @@ public:
bool write_to_file(const StringView& path);
GTextRange find(const StringView&, const GTextPosition& start = {});
GTextPosition next_position_after(const GTextPosition&, ShouldWrapAtEndOfDocument = ShouldWrapAtEndOfDocument::Yes);
GTextRange find_next(const StringView&, const GTextPosition& start = {});
GTextRange find_prev(const StringView&, const GTextPosition& start = {});
GTextPosition next_position_after(const GTextPosition&, ShouldWrapAtEndOfDocument = ShouldWrapAtEndOfDocument::Yes);
GTextPosition prev_position_before(const GTextPosition&, ShouldWrapAtStartOfDocument = ShouldWrapAtStartOfDocument::Yes);
bool has_selection() const { return m_selection.is_valid(); }
String selected_text() const;
void set_selection(const GTextRange&);