-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Ctrl+U shortcut #1703
Add Ctrl+U shortcut #1703
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If nextTick
works here, I'd use it instead of setTimeout
Like so? jumpToStart() {
const el = this.$refs['terminal-input'];
if (el.setSelectionRange) el.setSelectionRange(0, 0);
},
deleteBeforeCursorAndJumpToStart() {
this.removeBeforeCursor();
this.$nextTick(() => {
this.jumpToStart();
})
}, |
I'd just replace setTimeout with next tick: if (el.setSelectionRange) {
this.$nextTick(() => el.setSelectionRange(0, 0));
} I do not know why you require |
I'm not sure about this too, but it's required in this case to use moveCursorToEnd() {
const el = this.$refs['terminal-input'];
const len = this.command.length;
if (el.setSelectionRange) setTimeout(() => el.setSelectionRange(len, len), 0);
} |
Ah right, you followed the pattern. This is good. @MrBurrBurr merge? Apart from fulfilling Botan's request, this looks solid and harmless. |
I will take a look and see why we are using Other than that, thank you @nuckle for your contribution - LGTM! |
Description
Closes this issue - #1689
Screenshots
Before pressing Ctrl+U
After pressing Ctrl+U
Additional information
This shortcut needs to be listed here - https://github.com/JustArchiNET/ASF-ui/wiki/Features#shortcuts
Checklist