diff --git a/src/utils/edit.c b/src/utils/edit.c index a43cf2fe6..eed2b534e 100644 --- a/src/utils/edit.c +++ b/src/utils/edit.c @@ -132,6 +132,8 @@ static void delete_word(void) cmdbuf_len--; while (cmdbuf_len > 0 && cmdbuf[cmdbuf_len - 1] != ' ') cmdbuf_len--; + if (cmdbuf_pos > cmdbuf_len) + cmdbuf_pos = cmdbuf_len; edit_redraw(); }