Closed asdf8dfafjk closed 4 years ago
On this line, #[override_default]
makes it so postprocess_matches
is always overridden, even when the autoselect
flag is not specified. I'm guessing you meant #[override_flag(flag = autoselect)]
so that it's only active when --autoselect
is passed?
Doing this will take out the need to check CLAP_FLAGS
, and take out the relevant import.
Just replacing that single line #[override_default]
with #[override_flag(flag = autoselect)]
gives me
error[E0599]: no method named `postprocess_matches` found for mutable reference `&mut drw::Drw` in the current scope
--> build/../dmenu/item.rs:99:26
|
99 | let items_to_draw = drw.postprocess_matches(pre_processed_items)?;
| ^^^^^^^^^^^^^^^^^^^ method not found in `&mut drw::Drw`
I don't know much about this error- wondering if you have a quick pointer to what might be wrong?
I think I've found the issue, and it's not due to your code. #[override_flag(flag = autoselect)]
does work if you make clean
and then make
. I believe what's happening is overrider
isn't updating its watchlist when plugin files are changed. This is a build issue, so I'll sort it out shortly.
As a workaround in the meantime, use #[override_flag(flag = autoselect)]
and then make clean
to get the watchlist fixed, before testing changes. That should sort things out enough to get this figured out.
I've pushed a fix to the issue I just mentioned to the develop branch. If you rebase (or re-fork or whatever) to get the changes down to your local branch the build issue should be resolved.
Thanks for your patience.
I did the change you asked for.
Looks good. Thanks for your contribution.
Add autoselect flag which would autoselect if there is only one current match