Minor fixes to w command, still glitchy

This commit is contained in:
sloumdrone 2020-01-02 23:06:02 -08:00
parent c84afc7614
commit 7d3dba06c3
1 changed files with 6 additions and 1 deletions

View File

@ -1256,9 +1256,14 @@ void editorCommandKp(int c) {
editorNextWord();
int len = start_y == E.cy ? E.cx - start_x : E.row[start_y].size - start_x;
editorUpdatePaste(&E.row[start_y].chars[start_x], len);
while (E.cy != start_y || E.cx != start_x) {
if (E.cy != start_y) {
E.cy--;
E.cx = E.row[E.cy].size;
}
while (E.cx != start_x) {
editorDeleteChar();
}
if (E.cx > E.row[E.cy].size - 1) E.cx--;
} else {
editorNextWord();
}