Restore Composer History under shift-up & down#3098
Conversation
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
bwindels
left a comment
There was a problem hiding this comment.
Code looks good, but agree shift+up is suboptimal as it'll select the line, at which point you need to deselect the line to go back another step... wdyt @lampholder ?
|
So, after some discussion (on the internal room, sorry, should have taken riot-dev) we've decided we can steal the alt+up/down shortcut from moving between rooms, as that is unusable as it is anyway. You want to make that change, or shall I finish it off? |
|
I will make it within a couple of hours :) |
Sure, thanks! |
…thub.com:matrix-org/matrix-react-sdk into t3chguy/restore_composer_history # Conflicts: # src/components/views/rooms/MessageComposerInput.js
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
bwindels
left a comment
There was a problem hiding this comment.
thanks for the changes! One suggestion for making onVerticalArrow a bit more readable perhaps.
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
bwindels
left a comment
There was a problem hiding this comment.
thanks for the changes! two more things though :)
| const selection = this.state.editorState.selection; | ||
| if (e.altKey) { | ||
| // Try select composer history | ||
| const selected = this.selectHistory(up); |
There was a problem hiding this comment.
shouldn't this also only happen if the selection is collapsed?
| // and we must be at the edge of the document (up=start, down=end) | ||
| if (!selection.anchor.isAtStartOfNode(document)) return; | ||
|
|
||
| if (!e.altKey) { |
|
merged this, as I need to bring the history back as part of feature guarding up-to-edit ... |
|
Sorry about not having time to bring it up to scratch. I'm future feel free to commit onto my branches to keep the changes consistent. Thanks for taking this on |
All good, will do 👍 |
Fixes element-hq/element-web#9977
Shift-up is imperfect as spamming shift-up will not go up multiple history entries as it'll highlight a line in your history instead, maybe an alternative modifier would be better
Signed-off-by: Michael Telatynski 7t3chguy@gmail.com