Updates selection without redraw for cursor_right().

This commit is contained in:
Bobbi Webber-Manners 2020-08-04 17:49:27 -04:00
parent c69453ab62
commit 69ddaab305

View File

@ -817,20 +817,24 @@ void cursor_right(void) {
gapbuf[gapbegin++] = gapbuf[++gapend]; gapbuf[gapbegin++] = gapbuf[++gapend];
else { else {
beep(); beep();
gotoxy(curscol, cursrow); goto done;
return;
} }
++curscol; ++curscol;
if (gapend == BUFSZ - 1) { if (gapend == BUFSZ - 1)
gotoxy(curscol, cursrow); goto done;
return;
}
if (curscol == rowlen[cursrow]) { if (curscol == rowlen[cursrow]) {
if (cursrow == NROWS - 1) if (cursrow == NROWS - 1)
scroll_down(); scroll_down();
++cursrow; ++cursrow;
curscol = 0; curscol = 0;
} }
done:
if (mode > SEL_MOVE2) {
endsel = gapbegin;
revers(1);
cputc(gapbuf[gapbegin - 1]);
revers(0);
}
gotoxy(curscol, cursrow); gotoxy(curscol, cursrow);
} }
#pragma code-name (pop) #pragma code-name (pop)
@ -1388,10 +1392,6 @@ int edit(char *fname) {
break; break;
case 0x15: // Right case 0x15: // Right
cursor_right(); cursor_right();
if (mode > SEL_MOVE2) {
endsel = gapbegin;
draw_screen();
}
break; break;
case 0x0b: // Up case 0x0b: // Up
cursor_up(); cursor_up();