Fixed bug with highlighting of selection

This commit is contained in:
Bobbi Webber-Manners
2020-08-01 20:35:34 -04:00
parent d30af5e7da
commit 2917f00f14

View File

@@ -5,7 +5,6 @@
// Note: Use my fork of cc65 to get a flashing cursor!! // Note: Use my fork of cc65 to get a flashing cursor!!
// TODO: Bug - when doing selection, if cursor in on CR then whole screen gets highlighted
// TODO: Bug handling file with lines of 80 chars + CR. Cursor right doesn't // TODO: Bug handling file with lines of 80 chars + CR. Cursor right doesn't
// work properly at the end of such lines // work properly at the end of such lines
// TODO: Minor bug - can delete too many chars from status line // TODO: Minor bug - can delete too many chars from status line
@@ -498,13 +497,8 @@ uint8_t save_file(char *filename) {
*/ */
uint8_t read_char_update_pos(void) { uint8_t read_char_update_pos(void) {
char c; char c;
if ((pos >= startsel) && (pos <= endsel))
revers(1);
else
revers(0);
if ((c = gapbuf[pos++]) == EOL) { if ((c = gapbuf[pos++]) == EOL) {
if (do_print) { if (do_print) {
revers(0);
rowlen[row] = col + 1; rowlen[row] = col + 1;
clreol_wrap(); clreol_wrap();
gotox(0); gotox(0);
@@ -513,6 +507,10 @@ uint8_t read_char_update_pos(void) {
col = 0; col = 0;
return 1; return 1;
} }
if ((pos >= startsel) && (pos <= endsel))
revers(1);
else
revers(0);
if (do_print) if (do_print)
cputc(c); cputc(c);
revers(0); revers(0);