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

Add Shift-Tab completion to gui-readline #830

Merged
merged 3 commits into from Jan 30, 2018

Conversation

Projects
None yet
3 participants
@g-elfling
Copy link
Contributor

g-elfling commented Jan 23, 2018

Add completion because pressing only <Tab> to complete the commands is allowed. <Shift><Tab> is not allowed, it doesn't do anything. For example in /q<Tab> cycles through commands /query, /quit, /quote, and /Q. So if one would type /qu<Tab> to complete to /query and then press <Shift> to cycle next to /quit. After that pressing <Shift><Tab> it would complete back to /query.

Fixes issue #829

@@ -1278,7 +1279,7 @@ void gui_readline_init(void)

/* line transmitting */
key_bind("send_line", "Execute the input line", "return", NULL, (SIGNAL_FUNC) key_send_line);
key_bind("word_completion_backward", "", NULL, NULL, (SIGNAL_FUNC) key_word_completion_backward);
key_bind("word_completion_backward", "Completes the previous word", "shifttab", NULL, (SIGNAL_FUNC) key_word_completion_backward);

This comment has been minimized.

@dequis

dequis Jan 24, 2018

Member

This is confusing, it was the first thing I read in this PR and what I interpreted was that, given a b<Tab> it completes based on a instead of b

This comment has been minimized.

@ailin-nemui

ailin-nemui Jan 24, 2018

Contributor

Hard to come up with a good description.. maybe something like "Choose previous completion suggestion" ?

This comment has been minimized.

@g-elfling

g-elfling Jan 24, 2018

Author Contributor

Ok done :P Dunno if "suggestion" word if redundant tho?

@ailin-nemui

This comment has been minimized.

Copy link
Contributor

ailin-nemui commented Jan 24, 2018

you can already do this without changing the source code with /bind meta2-Z key stab and /bind stab word_completion_backward
it's a good idea to make it default though

@@ -1174,6 +1174,7 @@ void gui_readline_init(void)
key_bind("key", NULL, "^H", "backspace", (SIGNAL_FUNC) key_combo);
key_bind("key", NULL, "^?", "backspace", (SIGNAL_FUNC) key_combo);
key_bind("key", NULL, "^I", "tab", (SIGNAL_FUNC) key_combo);
key_bind("key", NULL, "meta2-Z", "shifttab", (SIGNAL_FUNC) key_combo);

This comment has been minimized.

@ailin-nemui

ailin-nemui Jan 24, 2018

Contributor

rename this to stab to stay in line with the existing chome and mup

This comment has been minimized.

@g-elfling

g-elfling Jan 24, 2018

Author Contributor

ah yeah ofc, done

@ailin-nemui

This comment has been minimized.

Copy link
Contributor

ailin-nemui commented Jan 24, 2018

..Makes me wonder if there is any way to undo a completion completely and revert to before I used Tab

@g-elfling

This comment has been minimized.

Copy link
Contributor Author

g-elfling commented Jan 24, 2018

Couldn't find that kinda feature, why not make it loool ;) It was weird that this key_word_completion_backward thing was built already but was not bound to shift-tab?

@ailin-nemui

This comment has been minimized.

Copy link
Contributor

ailin-nemui commented Jan 25, 2018

@ailin-nemui ailin-nemui merged commit 8028dcf into irssi:master Jan 30, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.