[GNC-dev] Ideas for account type-ahead modification

jean ripngo at gmail.com
Fri Mar 27 11:16:52 EDT 2020


I gave that a shot. See
https://github.com/jeanlaroche/gnucash.git
eea20a8da..d0ee8a161  fix_autocompletion_master
But see comments below:

> Imagine we have the following account tree:
 >
> Assets:Cash
> Assets:Bank
> Income:Salary
> Expenses:Bets
> Expenses:Bets:Blue
> 
> Typing 'et' will filter the list of accounts to show to
> 
> Assets:Cash
> Assets:Bank
> Expenses:Bets
> Expenses:Bets:Blue
> 
> Subsequently typing ":" will autocomplete 'et' to 'ets:' and reduce the list to >
> Assets:Cash
> Assets:Bank
> Expenses:Bets:Blue

I haven't implemented the autocomplete because in most cases I"m not 
sure what to do:

What if you have:

Assets:Cash
Expenses:Bets
Forgeta:Foo

All three match "et" but what do we do if the user type ":" ? In which 
situation can we autocomplete? In the current search, ":" autocompletes 
the current match (i.e., it moves the cursor to the next :). But in the 
mixed search, it's not clear what it should do.
Should I treat ":" as .*: (non greedy) in regexp? I think that would be 
pretty cool and it would be consistent with the legacy behavior.

In any case, the merging of the two searches actually does work 
currently and is fairly intuitive. So if you guys like this solution 
then I could remove the option, which would be really good!
Jean


More information about the gnucash-devel mailing list