Removes the character preceding the caret in the currently entered text */
| 252 | |
| 253 | /* Removes the character preceding the caret in the currently entered text */ |
| 254 | static void LInput_Backspace(struct LInput* w) { |
| 255 | if (!w->text.length || w->caretPos == 0) return; |
| 256 | |
| 257 | if (w->caretPos == -1) { |
| 258 | String_DeleteAt(&w->text, w->text.length - 1); |
| 259 | } else { |
| 260 | String_DeleteAt(&w->text, w->caretPos - 1); |
| 261 | w->caretPos--; |
| 262 | if (w->caretPos == -1) w->caretPos = 0; |
| 263 | } |
| 264 | |
| 265 | if (w->TextChanged) w->TextChanged(w); |
| 266 | LInput_ClampCaret(w); |
| 267 | LBackend_InputUpdate(w); |
| 268 | } |
| 269 | |
| 270 | /* Removes the character at the caret in the currently entered text */ |
| 271 | static void LInput_Delete(struct LInput* w) { |
no test coverage detected