codythegreat / dss

Dead Simple Slides - A terminal based presentation tool with Vim style keybindings
MIT License
54 stars 3 forks source link

Shared Logic between Command Mode and Search Mode #34

Closed codythegreat closed 4 years ago

codythegreat commented 4 years ago

Command and Search use very similar logic for parsing user input. The logic functions like this:

I believe that this logic should be it's own function like so:

int parseUserInput(char *bufferToWriteTo) {
    // parse input
    // write to supplied buffer (if needed)
    // return 0 (fail) 1 (success)
}

This will allow code reuse, and any function that uses user input in the future will benefit from this function.

codythegreat commented 4 years ago

Implemented in commit f18b0aba660bd7dd4edeb00e6ff66cf8d40d0f6d