Bring implementation of XTSAVE and XTRESTORE into line with xterm

Now a stack of depth 1 is used to save/restore private mode values. And
saving/restoring individual modes is supported. This latter is used by
midnight commander.
This commit is contained in:
Kovid Goyal
2021-09-14 21:59:41 +05:30
parent 4c25ceff29
commit 2a8fd278c1
4 changed files with 89 additions and 26 deletions

View File

@@ -67,11 +67,6 @@ typedef struct {
} Savepoint;
typedef struct {
ScreenModes buf[SAVEPOINTS_SZ];
index_type start_of_data, count;
} SavemodesBuffer;
typedef struct {
CPUCell *cpu_cells;
GPUCell *gpu_cells;
@@ -98,14 +93,13 @@ typedef struct {
bool use_latin1, is_dirty, scroll_changed, reload_all_gpu_data;
Cursor *cursor;
Savepoint main_savepoint, alt_savepoint;
SavemodesBuffer modes_savepoints;
PyObject *callbacks, *test_child;
LineBuf *linebuf, *main_linebuf, *alt_linebuf;
GraphicsManager *grman, *main_grman, *alt_grman;
HistoryBuf *historybuf;
unsigned int history_line_added_count;
bool *tabstops, *main_tabstops, *alt_tabstops;
ScreenModes modes;
ScreenModes modes, saved_modes;
ColorProfile *color_profile;
monotonic_t start_visual_bell_at;
@@ -143,7 +137,9 @@ void screen_align(Screen*);
void screen_restore_cursor(Screen *);
void screen_save_cursor(Screen *);
void screen_restore_modes(Screen *);
void screen_restore_mode(Screen *, unsigned int);
void screen_save_modes(Screen *);
void screen_save_mode(Screen *, unsigned int);
bool write_escape_code_to_child(Screen *self, unsigned char which, const char *data);
void screen_cursor_position(Screen*, unsigned int, unsigned int);
void screen_cursor_back(Screen *self, unsigned int count/*=1*/, int move_direction/*=-1*/);