1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +00:00

LibGUI: Unindent selected text on shift+tab press

Selected text is unindented when Shift+Tab is pressed. Select text,
indent it with Tab, then unindent with Shift+Tab.
This commit is contained in:
huttongrabiel 2022-06-18 12:03:49 -07:00 committed by Sam Atkins
parent 2fbaa7996c
commit 9369610bf4
4 changed files with 63 additions and 0 deletions

View file

@ -271,4 +271,16 @@ private:
TextRange m_range;
};
class UnindentSelection : public TextDocumentUndoCommand {
public:
UnindentSelection(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;
};
}