Revert back to saving buffer cursor position
In v1.70 I had saved the cursor position relative to the window, but that means should the window scroll, the cursor would appear to be restored to the wrong position. It will still be wrong should the *buffer* be scrolled, but that can't really be helped (well, possibly it could, but it would be more effort than it's worth).
This commit is contained in:
parent
b5e7a01f7f
commit
67f1d48801
13
ANSI.c
13
ANSI.c
@ -152,8 +152,9 @@
|
||||
remove wcstok, avoiding potential interference with the host;
|
||||
similarly, use a private heap instead of malloc.
|
||||
|
||||
v1.80, 26 October, 2017:
|
||||
fix unloading.
|
||||
v1.80, 26 to 28 October, 2017:
|
||||
fix unloading;
|
||||
revert back to (re)storing buffer cursor position.
|
||||
*/
|
||||
|
||||
#include "ansicon.h"
|
||||
@ -1076,16 +1077,12 @@ void InterpretEscSeq( void )
|
||||
|
||||
case 's': // ESC[s Saves cursor position for recall later
|
||||
if (es_argc != 0) return;
|
||||
pState->SavePos.X = CUR.X;
|
||||
pState->SavePos.Y = CUR.Y - TOP;
|
||||
DEBUGSTR( 1, "SavePos = %u,%u; CUR = %u,%u; TOP = %u, .Top = %u",
|
||||
pState->SavePos.X, pState->SavePos.Y, CUR.X, CUR.Y, TOP, Info.srWindow.Top );
|
||||
pState->SavePos = CUR;
|
||||
return;
|
||||
|
||||
case 'u': // ESC[u Return to saved cursor position
|
||||
if (es_argc != 0) return;
|
||||
Pos.X = pState->SavePos.X;
|
||||
Pos.Y = pState->SavePos.Y + TOP;
|
||||
Pos = pState->SavePos;
|
||||
if (Pos.X > RIGHT) Pos.X = RIGHT;
|
||||
if (Pos.Y > BOTTOM) Pos.Y = BOTTOM;
|
||||
SetConsoleCursorPosition( hConOut, Pos );
|
||||
|
@ -87,7 +87,7 @@
|
||||
add error codes to some message.
|
||||
*/
|
||||
|
||||
#define PDATE L"26 October, 2017"
|
||||
#define PDATE L"28 October, 2017"
|
||||
|
||||
#include "ansicon.h"
|
||||
#include "version.h"
|
||||
|
@ -295,8 +295,9 @@ Version History
|
||||
|
||||
Legend: + added, - bug-fixed, * changed.
|
||||
|
||||
1.80 - 27 October, 2017:
|
||||
- fix unloading.
|
||||
1.80 - 28 October, 2017:
|
||||
- fix unloading;
|
||||
* go back to saving the buffer cursor position.
|
||||
|
||||
1.72 - 24 December, 2015:
|
||||
- handle STD_OUTPUT_HANDLE & STD_ERROR_HANDLE in WriteFile;
|
||||
@ -524,4 +525,4 @@ Distribution
|
||||
|
||||
|
||||
=============================
|
||||
Jason Hood, 27 October, 2017.
|
||||
Jason Hood, 28 October, 2017.
|
||||
|
Loading…
x
Reference in New Issue
Block a user