fix killLastWord

svn-id: r9896
This commit is contained in:
Oliver Kiehl 2003-08-28 19:46:52 +00:00
parent 898bbc85d0
commit 2a89cd9c9d

View file

@ -349,13 +349,16 @@ void ConsoleDialog::killLine() {
void ConsoleDialog::killLastWord() { void ConsoleDialog::killLastWord() {
int pos; int pos;
int cnt = 0; int cnt = 0;
bool space = true;
while (_currentPos > _promptStartPos) { while (_currentPos > _promptStartPos) {
_currentPos--;
pos = getBufferPos(); pos = getBufferPos();
if (_buffer[pos] != ' ') if (_buffer[pos-1] == ' ') {
cnt++; if (!space)
else
break; break;
} else
space = false;
_currentPos--;
cnt++;
} }
for (int i = _currentPos; i < _promptEndPos; i++) for (int i = _currentPos; i < _promptEndPos; i++)