oh-my-fish / plugin-expand

Provides interactive word expansions in real-time
MIT License
53 stars 9 forks source link

expand:choose-next tab completion behaviour changed from fish 3.0 default #2

Open ipwnponies opened 5 years ago

ipwnponies commented 5 years ago

This plugin overrides the default binding for \t from complete to expand:execute. If no expand rules match, the completion behaviour is supposed to fall back to default complete (show completion list and pager navigation for subsequent Tab).

With fish 3.0, there were some changes to handling of tab completion. This causing the expand:choose-next function to not work the same as previously. It no-ops instead of scrolling through the choices (emulating default complete behaviour).

ipwnponies commented 5 years ago

This seems to be caused by commandline -f complete https://github.com/oh-my-fish/plugin-expand/blob/cb5e01e542d5dbdb77a964b414f192d770ddf3e2/functions/expand:execute.fish#L21-L25

I tested the behaviour of complete vs. commandline -f complete, on fish 3.0.0 and fish 2.7.1:

bind \t complete
bind \cx 'commandline -f complete'

complete will show and invoke completion pager, allowing for scrolling through entries with each subsequent key press. commandline -f complete only shows the completions, it doesn't enter the pager. Aftering entering the pager manually (using tab or arrow keys), then it will allow scrolling.