tried to improve the documentation of the function utils_removeChars + made it more defensive + fixed the testcases
This commit is contained in:
@@ -215,13 +215,14 @@ void utils_insertChars( shellmatta_instance_t *inst,
|
||||
* position
|
||||
* @param[in] inst pointer to a shellmatta instance
|
||||
* @param[in] length number of characters to remove
|
||||
* @param[in] backspace remove characters left of the cursor
|
||||
* @param[in] backspace true ==> remove characters left of the cursor
|
||||
* false ==> remove characters right of the cursor
|
||||
*/
|
||||
void utils_removeChars( shellmatta_instance_t *inst,
|
||||
uint32_t length,
|
||||
bool backspace)
|
||||
{
|
||||
if(0u != length)
|
||||
if((0u != length) && (inst->inputCount >= inst->cursor))
|
||||
{
|
||||
/** -# rewind the cursor in case of backspace */
|
||||
if(true == backspace)
|
||||
|
Reference in New Issue
Block a user