~rjarry/aerc#210: 
flag gets added on keybind press

Having

o = :rmdir<space>

in binds.conf, one would expect that :rmdir would be prefilled to the prompt when one presses "o", however instead :rmdir -f gets filled in. This however doesn't seem to be the case for commands where there are multiple flags.

Status
RESOLVED FIXED
Submitter
~balejk
Assigned to
No-one
Submitted
1 year, 5 months ago
Updated
1 year, 4 months ago
Labels
bug

~konimarti 1 year, 5 months ago*

I can reproduce it. A quick bisect points to commit b3dc63d6 ("complete: only display popover for more than one choice").

Aerc sends a tab after evaluating a keybind at app/aerc.go:290 to trigger the completion popover. However, with commit b3dc63d6 applied, the simulated tab key will complete the flag if it is the only option for the given command (as is the case for :rmdir -f).

~balejk 1 year, 5 months ago

eliminate line 290 and expect the user the explictely ask for in the keybinds if you want the completions menu to pop up automatically.

Without any deeper insight, this sounds very sensible to me.

~rjarry 1 year, 5 months ago*

Hmm, weird. If you look at #104, this "feature" was accidently removed by a rework and somebody requested that we add it back.

I tried removing this line and it fixes the annoying popup but adding o = :rmdir<space><tab> does not trigger completion. Maybe we need to change something else.

I also have an idea for a quality of life fix in go-opt: flags should only be proposed in completion choices if the current word starts with a - what do you think?

~konimarti 1 year, 5 months ago

I tried removing this line and it fixes the annoying popup but adding o = :rmdir<space><tab> does not trigger completion. Maybe we need to change something else.

I made the same observation after writing my inital response. This needs more analysis. But getting rid of this "magic" tab key seems worthwhile since it seems more like workaround than a fix.

I also have an idea for a quality of life fix in go-opt: flags should only be proposed in completion choices if the current word starts with a - what do you think?

I do like the current go-opt behavior, except that side effect that is probably related to that tab key.

~rjarry REPORTED FIXED 1 year, 4 months ago

Robin Jarry referenced this ticket in commit 64d76e3.

Register here or Log in to comment, or comment via email.