From 59cab76dd89d96cdcc446567711462eb1c53ca35 Mon Sep 17 00:00:00 2001 From: Nicolas Viennot Date: Wed, 26 Jun 2013 00:54:27 -0400 Subject: [PATCH] Fix copy mode when the buffer size is smaller than 2000 --- tmate-encoder.c | 3 ++- tmate.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tmate-encoder.c b/tmate-encoder.c index 7cd11dbb..3db8e8d7 100644 --- a/tmate-encoder.c +++ b/tmate-encoder.c @@ -203,7 +203,8 @@ void tmate_sync_copy_mode(struct window_pane *wp) if (data->screen.sel.flag) { pack(array, 3); pack(int, data->selx); - pack(int, data->sely); + pack(int, -data->sely + screen_hsize(data->backing) + + screen_size_y(data->backing) - 1); pack(int, data->rectflag); } else pack(array, 0); diff --git a/tmate.h b/tmate.h index 899a5f17..dea7e56d 100644 --- a/tmate.h +++ b/tmate.h @@ -17,7 +17,7 @@ #define TMATE_MAX_MESSAGE_SIZE (16*1024) -#define TMATE_PROTOCOL_VERSION 1 +#define TMATE_PROTOCOL_VERSION 2 enum tmate_commands { TMATE_HEADER,