diff --git a/gui/console.cpp b/gui/console.cpp index 48a370c82c2..a5c71dffc40 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -349,13 +349,16 @@ void ConsoleDialog::killLine() { void ConsoleDialog::killLastWord() { int pos; int cnt = 0; + bool space = true; while (_currentPos > _promptStartPos) { - _currentPos--; pos = getBufferPos(); - if (_buffer[pos] != ' ') - cnt++; - else - break; + if (_buffer[pos-1] == ' ') { + if (!space) + break; + } else + space = false; + _currentPos--; + cnt++; } for (int i = _currentPos; i < _promptEndPos; i++)