Closed dmd closed 1 month ago
I agree with you on this, @dmd. I'll tackle this next.
Heres the PR @dmd if you want to see how i tackled it: https://github.com/squidowl/halloy/pull/509
Looks like it always only completes the nick - but doesn't add the colon or space if appropriate to do so.
(Colon) space is handled by complete_input
in completion.rs
:slightly_smiling_face:
I guess I don't understand how to actually trigger the behavior in the app; I expect the weechat-like behavior described above, but I find that under no circumstances do I get a colon or space.
You're building from the branch, and you're seeing user tab completion working except for appending (colon) space? Having trouble getting that behavior to repro over here.
Sorry I'm a moron I forgot to checkout the branch.
Weechat does something smart when nicknames are tab-completed which I think halloy should copy.
:
(colon space) is appended to the completionI don't think this even needs to be an option; I honestly can't think of any reason not to just make it the sole behavior.
It looks you already thought of this (except putting a space after the nick in the 2nd cases):
https://github.com/squidowl/halloy/blob/890da2d8c2db931639dec45a0a38b5f75002eb6f/src/buffer/input_view.rs#L301-L307
... but it is only for what happens when someone clicks on a nick in the nicklist, which ... does anyone do that?
I looked into implementing this myself (even though I don't know Rust) but got stymied because by the time
tab
is called, it no longer knows whetherfiltered
was populated byprocess_users
orprocess_channels
. I added such a flag to the Text struct but then realizedtab
doesn't have theinput
context and at that point I realized if you want to do this you could do it in 30 seconds because you actually know how this code works (I guess you'd check if input == prompt to see if we're at the beginning of the line??)