diff --git a/src/bin/termio.c b/src/bin/termio.c index 57b7623a..006a5e41 100644 --- a/src/bin/termio.c +++ b/src/bin/termio.c @@ -3932,7 +3932,7 @@ _smart_pty_change(void *data) } void -termio_scroll(Evas_Object *obj, int direction) +termio_scroll(Evas_Object *obj, int direction, int start_y, int end_y) { Termio *sd; Termpty *ty; @@ -3951,8 +3951,19 @@ termio_scroll(Evas_Object *obj, int direction) ty = sd->pty; if (ty->selection.is_active) { - ty->selection.start.y += direction; - ty->selection.end.y += direction; + if (start_y <= ty->selection.start.y && + end_y >= ty->selection.end.y) + { + ty->selection.start.y += direction; + ty->selection.end.y += direction; + if (!(start_y <= ty->selection.start.y && + end_y >= ty->selection.end.y)) + _sel_set(obj, EINA_FALSE); + } + else + if (!((start_y > ty->selection.end.y) || + (end_y < ty->selection.start.y))) + _sel_set(obj, EINA_FALSE); } } diff --git a/src/bin/termio.h b/src/bin/termio.h index fd3867f3..9cdb3bc4 100644 --- a/src/bin/termio.h +++ b/src/bin/termio.h @@ -12,7 +12,7 @@ char *termio_selection_get(Evas_Object *obj, int c1x, int c1y, int c2x, int c2y, size_t *len); Eina_Bool termio_selection_exists(const Evas_Object *obj); -void termio_scroll(Evas_Object *obj, int direction); +void termio_scroll(Evas_Object *obj, int direction, int start_y, int end_y); void termio_content_change(Evas_Object *obj, Evas_Coord x, Evas_Coord y, int n); void termio_config_update(Evas_Object *obj); diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c index 428d7d87..07fe89d0 100644 --- a/src/bin/termptyops.c +++ b/src/bin/termptyops.c @@ -74,7 +74,7 @@ _termpty_text_scroll(Termpty *ty, Eina_Bool clear) if (!ty->altbuf) termpty_text_save_top(ty, &(TERMPTY_SCREEN(ty, 0, 0)), ty->w); - termio_scroll(ty->obj, -1); + termio_scroll(ty->obj, -1, start_y, end_y); DBG("... scroll!!!!! [%i->%i]", start_y, end_y); if (start_y == 0 && end_y == ty->h - 1) @@ -114,7 +114,7 @@ _termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear) end_y = ty->state.scroll_y2 - 1; } DBG("... scroll rev!!!!! [%i->%i]", start_y, end_y); - termio_scroll(ty->obj, 1); + termio_scroll(ty->obj, 1, start_y, end_y); if (start_y == 0 && end_y == ty->h - 1) {