I noticed that while pressing tab the cursor last keystroke was not being updated:
case SDLK_TAB: {
for (size_t i = 0; i < 4; ++i) {
editor_insert_char(&editor, ' ');
}
}
it should be:
case SDLK_TAB: {
for (size_t i = 0; i < 4; ++i) {
editor_insert_char(&editor, ' ');
}
editor.last_stroke = SDL_GetTicks();
}
but instead of updating the last keystroke individually in every key press, it's better to update it when a key is pressed regardless if the key being pressed has a dedicated function or not.
This commit removes all the editor.last_stroke = SDL_GetTicks(); from every key case and adds only one after the switch execution.
I noticed that while pressing tab the cursor last keystroke was not being updated:
it should be:
but instead of updating the last keystroke individually in every key press, it's better to update it when a key is pressed regardless if the key being pressed has a dedicated function or not.
This commit removes all the
editor.last_stroke = SDL_GetTicks();
from every key case and adds only one after theswitch
execution.