mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-01 15:18:06 +00:00
LibGUI: Indent selected text on tab press
If selected text is less than a whole line, usual delete/replace takes place. Otherwise, if the selected text is a whole line or spans multiple lines, the selection will be indented.
This commit is contained in:
parent
80705a72bd
commit
2fbaa7996c
Notes:
sideshowbarker
2024-07-17 22:41:14 +09:00
Author: https://github.com/huttongrabiel
Commit: 2fbaa7996c
Pull-request: https://github.com/SerenityOS/serenity/pull/13269
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/linusg
4 changed files with 80 additions and 2 deletions
|
@ -259,4 +259,16 @@ private:
|
|||
String m_action_text;
|
||||
};
|
||||
|
||||
class IndentSelection : public TextDocumentUndoCommand {
|
||||
public:
|
||||
IndentSelection(TextDocument&, size_t tab_width, TextRange const&);
|
||||
virtual void undo() override;
|
||||
virtual void redo() override;
|
||||
TextRange const& range() const { return m_range; }
|
||||
|
||||
private:
|
||||
size_t m_tab_width { 0 };
|
||||
TextRange m_range;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue