FaisalBinAhmed / MVGFahrinfo

Get up-to-date departure times for Munich public transport in your terminal.
https://crates.io/crates/mvgfahrinfo
MIT License
77 stars 4 forks source link

Can not enter the char 'c' in the searchbar #4

Closed cato447 closed 11 months ago

cato447 commented 11 months ago

When searching for a station the character c is not accepted as input.

For example: Searching for Candidplatz results in only the string andidplatz getting displayed in the searchbox image

For stations like Candidplatz this is not an issue since the station will be found either way. However this is problematic for stations like Hackerbrücke which result in the search string Hakerbrüke which is obviously not yielding any results.

cato447 commented 11 months ago

I looked into the Codebase and found why the program is behaving like this

In update.rs at line 51 following code matches any 'c' or 'C' entered into the search bar and just ignores it.

KeyCode::Char('c') | KeyCode::Char('C') => {
    if key_event.modifiers == KeyModifiers::CONTROL {
        app.quit()
    }
}
FaisalBinAhmed commented 11 months ago

Hey thanks for opening this, looks like I made a blunder when copying over the code from normal mode. I already opened a PR #5 to fix this :)

cato447 commented 11 months ago

Perfect thanks 👍