forked from enlightenment/terminology
fix scrolling with selection on irssi in tmux. Closes T404
This commit is contained in:
parent
df2b87308b
commit
509a5d1a7b
|
@ -3932,7 +3932,7 @@ _smart_pty_change(void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
termio_scroll(Evas_Object *obj, int direction)
|
termio_scroll(Evas_Object *obj, int direction, int start_y, int end_y)
|
||||||
{
|
{
|
||||||
Termio *sd;
|
Termio *sd;
|
||||||
Termpty *ty;
|
Termpty *ty;
|
||||||
|
@ -3951,8 +3951,19 @@ termio_scroll(Evas_Object *obj, int direction)
|
||||||
ty = sd->pty;
|
ty = sd->pty;
|
||||||
if (ty->selection.is_active)
|
if (ty->selection.is_active)
|
||||||
{
|
{
|
||||||
ty->selection.start.y += direction;
|
if (start_y <= ty->selection.start.y &&
|
||||||
ty->selection.end.y += direction;
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ char *termio_selection_get(Evas_Object *obj,
|
||||||
int c1x, int c1y, int c2x, int c2y,
|
int c1x, int c1y, int c2x, int c2y,
|
||||||
size_t *len);
|
size_t *len);
|
||||||
Eina_Bool termio_selection_exists(const Evas_Object *obj);
|
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_content_change(Evas_Object *obj, Evas_Coord x, Evas_Coord y, int n);
|
||||||
|
|
||||||
void termio_config_update(Evas_Object *obj);
|
void termio_config_update(Evas_Object *obj);
|
||||||
|
|
|
@ -74,7 +74,7 @@ _termpty_text_scroll(Termpty *ty, Eina_Bool clear)
|
||||||
if (!ty->altbuf)
|
if (!ty->altbuf)
|
||||||
termpty_text_save_top(ty, &(TERMPTY_SCREEN(ty, 0, 0)), ty->w);
|
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);
|
DBG("... scroll!!!!! [%i->%i]", start_y, end_y);
|
||||||
|
|
||||||
if (start_y == 0 && end_y == ty->h - 1)
|
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;
|
end_y = ty->state.scroll_y2 - 1;
|
||||||
}
|
}
|
||||||
DBG("... scroll rev!!!!! [%i->%i]", start_y, end_y);
|
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)
|
if (start_y == 0 && end_y == ty->h - 1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue