fix killLastWord
svn-id: r9896
This commit is contained in:
parent
898bbc85d0
commit
2a89cd9c9d
1 changed files with 8 additions and 5 deletions
|
@ -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++)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue