summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amade@asmblr.net>2017-01-12 16:28:29 +0100
committerAmadeusz Sławiński <amade@asmblr.net>2017-04-06 11:34:04 +0200
commit8062db33b87ed86ec54222c83babbf1aa5866ec9 (patch)
treeca6512a69a119f0e6df79d3c23942164820e5364
parent7e755ed62d311b00102b053eee88359bbf8ac2df (diff)
downloadscreen-8062db33b87ed86ec54222c83babbf1aa5866ec9.tar.gz
fix restoring cursor position after leaving altscreen
When swapping to altscreen, also swap cursor position Bug: 49883
-rw-r--r--src/ansi.c2
-rw-r--r--src/resize.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/ansi.c b/src/ansi.c
index 0c9b022..cd4403b 100644
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -1446,8 +1446,8 @@ int c, intermediate;
else
{
if (curr->w_alt.on) {
- RestoreCursor(&curr->w_alt.cursor);
LeaveAltScreen(curr);
+ RestoreCursor(&curr->w_alt.cursor);
}
}
if (a1 == 47 && !i)
diff --git a/src/resize.c b/src/resize.c
index 9786164..ba7988d 100644
--- a/src/resize.c
+++ b/src/resize.c
@@ -1091,6 +1091,14 @@ struct win *p;
SWAP(width, t);
SWAP(height, t);
+ /* we need to swap cursor positions, but they are not swappable with macro */
+ t = p->w_alt.cursor.x;
+ p->w_alt.cursor.x = p->w_x;
+ p->w_x = t;
+ t = p->w_alt.cursor.y;
+ p->w_alt.cursor.y = p->w_y;
+ p->w_y = t;
+
#ifdef COPY_PASTE
SWAP(histheight, t);
SWAP(hlines, ml);