-
-
Notifications
You must be signed in to change notification settings - Fork 92
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 more cursor movements #154
base: main
Are you sure you want to change the base?
Conversation
Most of the input logic was duplicated in three places as of now: * Database filter input * SQL Editor * Table filter This is done in preparation for adding more cursor movement functionality for inputs.
<Ctrl-w> deletes the input from the current cursor position up to the first occurence of a whitespace before the current position.
The database tree was updated for the filter string of the previous key press before. This became more apparent with the new movements like 'delete word' (Ctrl-w).
This deletes in the left direction until a non alphanumeric character is found.
This makes UX much smoother IMHO. The filter focus is now moved back to the tree by pressing <Esc> while in filtering mode.
Move backwards until first non alphanumeric occurence.
Until the next occurence of a nonalphanumeric char.
Until a non alphanumeric char.
To be more consistent with wording.
Sorry for the late review. I will review when I have time. |
Hey, no worries and thanks for taking the time! From my point of view it is pretty complete now. |
self.focus = Focus::Tree; | ||
return Ok(EventState::Consumed); | ||
} | ||
Key::Ctrl('j') | Key::Ctrl('n') => { |
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.
Not sure if this is a desired change at all and wether we should take custom key bindings into account?
@@ -69,6 +69,7 @@ pub enum Key { | |||
Char(char), | |||
Ctrl(char), | |||
Alt(char), | |||
AltBackspace, |
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'm sure this can be done in a more elegant way like Alt(Key::Backspace)
? But I couldn't wrap my head around this.
Hey,
thanks for creating this app, I like it a lot! I thought it might make sense to provide more cursor movement / input editing keybindings. To start with Ctrl-w (word deletion) seemed useful to me in order to delete i.e. a database filter query quickly.
Following changes are included in this PR so far:
Any feedback (especially concerning the refactoring) very welcome, as I am not super proficient writing Rust so far.
sebashwa