buster / rrun

minimalistic command launcher in rust
GNU General Public License v2.0
112 stars 14 forks source link

Replace class mutation with iterator #7

Closed nightscape closed 8 years ago

nightscape commented 8 years ago

Hi @buster,

I'm trying to pimp rrun to support custom autocompletions. As a preparatory refactoring, I started out by removing the class mutation of BashAutoCompleter and returning an Iterator instead (which also allows you to do a lot more things with the result). I'm a Rust newbie, so I'm happy about all feedback :+1:

buster commented 8 years ago

Hi @nightscape,

great, if you improve on rrun! I've been using it all day in the last months now, but haven't found time to improve on it. The completion code could certainly be more flexible. I'm testing your changes now..

buster commented 8 years ago

Hi,

i've seen that the completion didn't work as before. When completing "wh", it always resolved to "which" but your version resolved to "while". Also completing "ato" resolved to "atom" for me but to "atrm" in your version. The reason was that the compgen output needs to be reversed... other then that, it works now, and thanks for your pull request! I've merged it into master now.