mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
LibGUI: Fix wrong cursor position after undoing RemoveTextCommand
When you undo some forward delete shortcuts like <Del> or <Ctrl-Del>, the cursor will be put at the end of the text deleted, while the right position should be the start of those text.
This commit is contained in:
parent
b78622ddf7
commit
200a4a00dd
3 changed files with 19 additions and 17 deletions
|
@ -254,7 +254,7 @@ private:
|
|||
|
||||
class RemoveTextCommand : public TextDocumentUndoCommand {
|
||||
public:
|
||||
RemoveTextCommand(TextDocument&, DeprecatedString const&, TextRange const&);
|
||||
RemoveTextCommand(TextDocument&, DeprecatedString const&, TextRange const&, TextPosition const&);
|
||||
virtual ~RemoveTextCommand() = default;
|
||||
virtual void undo() override;
|
||||
virtual void redo() override;
|
||||
|
@ -265,6 +265,7 @@ public:
|
|||
private:
|
||||
DeprecatedString m_text;
|
||||
TextRange m_range;
|
||||
TextPosition m_original_cursor_position;
|
||||
};
|
||||
|
||||
class InsertLineCommand : public TextDocumentUndoCommand {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue