diff options
author | Amadeusz Sławiński <amade@asmblr.net> | 2017-01-12 16:28:29 +0100 |
---|---|---|
committer | Amadeusz Sławiński <amade@asmblr.net> | 2017-04-06 11:34:04 +0200 |
commit | 8062db33b87ed86ec54222c83babbf1aa5866ec9 (patch) | |
tree | ca6512a69a119f0e6df79d3c23942164820e5364 | |
parent | 7e755ed62d311b00102b053eee88359bbf8ac2df (diff) | |
download | screen-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.c | 2 | ||||
-rw-r--r-- | src/resize.c | 8 |
2 files changed, 9 insertions, 1 deletions
@@ -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); |