Texteditor misses NULL checks in 'wrap text' code, moving cursur while
text is selected.
This commit is contained in:
Ton Roosendaal 2008-10-04 13:42:45 +00:00
parent f8d7da21b1
commit 324e1d57ac

@ -2134,7 +2134,7 @@ static void wrap_move_up(SpaceText *st, short sel) {
if (toline<fromline) text->sell= text->sell->prev; if (toline<fromline) text->sell= text->sell->prev;
if (c>text->sell->len) c= text->sell->len; if (c>text->sell->len) c= text->sell->len;
text->selc= c; text->selc= c;
} else { } else if(text->curl) {
txt_undo_add_toop(text, UNDO_CTO, fromline, text->curc, toline, c); txt_undo_add_toop(text, UNDO_CTO, fromline, text->curc, toline, c);
if (toline<fromline) text->curl= text->curl->prev; if (toline<fromline) text->curl= text->curl->prev;
if (c>text->curl->len) c= text->curl->len; if (c>text->curl->len) c= text->curl->len;
@ -2175,10 +2175,10 @@ static void wrap_move_down(SpaceText *st, short sel) {
if (toline>fromline) text->sell= text->sell->next; if (toline>fromline) text->sell= text->sell->next;
if (c>text->sell->len) c= text->sell->len; if (c>text->sell->len) c= text->sell->len;
text->selc= c; text->selc= c;
} else { } else if(text->curl) {
txt_undo_add_toop(text, UNDO_CTO, fromline, text->curc, toline, c); txt_undo_add_toop(text, UNDO_CTO, fromline, text->curc, toline, c);
if (toline>fromline) text->curl= text->curl->next; if (toline>fromline) text->curl= text->curl->next;
if (c>text->curl->len) c= text->curl->len; if (c > text->curl->len) c= text->curl->len;
text->curc= c; text->curc= c;
txt_pop_sel(text); txt_pop_sel(text);
} }