Skip to content
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

Allow jumping between words on the input line #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DjMorgul
Copy link

@DjMorgul DjMorgul commented Oct 5, 2024

Allow jumping between words on the input line when the focus is on it, with key combinations 'Command + Left' and 'Command + Right', instead of collapsing or expanding the channel list for the current server.

The later bindings were taking precedence even when the focus was on the input line (the BTextView to type IRC messages the user wants to send).

With the changes on this commit, when the focus is on the input line, these key combinations correctly move to the start of the current word or the previous word, or to the end of the current word or the next word. And when the focus is anywhere else, the behavior before this commit is replicated.

And the combinations 'Command + Shift + Left' and 'Command + Shift + Right' were also done to work correctly, moving the selection on the input line between words.

As the operation of expanding the channel list is harmless to the user (it will keep showing the server messages), and the collapse operation opens the server messages screen; changes the focus to the input line and moves its cursor to its end, 'Command + Right' will also expand the channel list if the cursor is at the end of the input line. This way the operation of collapsing the channel list can be intuitively undone by pressing 'Command + Right' right afterwards.

The opposite WAS NOT implemented, i.e. collapsing the channel list with 'Command + Left' when the cursor is at the start of the input line, because the collapsing operation hides the current channel messages (it's not harmless to the user's workflow).

when the focus is on it, with key combinations 'Command + Left' and 'Command + Right', instead of collapsing or expanding the channel list for the current server.

The later bindings were taking precedence even when the focus was on the input line (the BTextView to type IRC messages the user wants to send).

With the changes on this commit, when the focus is on the input line, these key combinations correctly move to the start of the current word or the previous word, or to the end of the current word or the next word. And when the focus is anywhere else, the behavior before this commit is replicated.

And the combinations 'Command + Shift + Left' and 'Command + Shift + Right' were also done to work correctly, moving the selection on the input line between words.

As the operation of expanding the channel list is harmless to the user (it will keep showing the server messages), and the collapse operation opens the server messages screen; changes the focus to the input line and moves its cursor to its end, 'Command + Right' will also expand the channel list if the cursor is at the end of the input line. This way the operation of collapsing the channel list can be intuitively undone by pressing 'Command + Right' right afterwards.

The opposite WAS NOT implemented, i.e. collapsing the channel list with 'Command + Left' when the cursor is at the start of the input line, because the collapsing operation hides the current channel messages (it's not harmless to the user's workflow).
@waddlesplash
Copy link
Member

Rather than adding special logic here, maybe we should just remove these shortcuts entirely? Are they even used? CC @humdingerb.

If we are going to keep them when the text view isn't selected, then this code could definitely be cleaned up.

@humdingerb
Copy link
Member

IMO both menu items to expand/collapse the "network list" (the actual outlinelist is weirdly labeled "Window list"...) do not need a shortcut. I've never used that shortcut, but always was annoyed the system wide ALT+left/right doesn't work when writing.

The menu items themselves aren't needed when we remove the shortcuts then at all IMO.

@humdingerb
Copy link
Member

nephele on IRC pointed out that instead of those two menus there could be one: "Expand/collapse network" with one shortcut, e.g. ALT+E.
I think that's a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants