-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ui: prompt: Better unicode support #295
Conversation
We copied over eval_movement from wezterm, that already solves most of our problems. self.cursor is now byte-based.
Should make for an easier implementation of other keys too (ctrl-k, etc) |
So now we should be able to type unicode in prompt right? |
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.
Looks good to me. At least unicode works now. But I think we should add the keys to use the functions.
Why not just import the original LineEditor
?
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.
Added a bunch more commands including |
BackwardChar(usize), | ||
BackwardWord(usize), | ||
ForwardChar(usize), | ||
ForwardWord(usize), |
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.
I don't think we support repetition for prompt since we only need one. I think we might be able to remove the usize here.
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.
Good point, I'll remove it
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.
Yeah wezterm also always uses 1, I guess it was added since you could do vi-mode for readline in the future with it
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.
Yeah, but I don't think we will be doing that any time soon right? At least I think vi-mode won't be useful in parts like prompt where a modal editor is not useful.
ForwardWord(usize), | ||
StartOfLine, | ||
EndOfLine, | ||
None, |
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.
In what case do we need this None
?
Going to merge this as is, |
We copied over eval_movement from wezterm, that already solves most of
our problems. self.cursor is now byte-based.
Fixes #293