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
commit 9369610bf4
Notes: sideshowbarker 2024-07-17 09:36:21 +09:00
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;
};
}