parent
ee4e56edf9
commit
7f90430414
@ -42,6 +42,7 @@ init_tabstops(bool *tabstops, index_type count) {
|
||||
self->g0_charset = translation_table(0); \
|
||||
self->g1_charset = self->g0_charset; \
|
||||
self->g_charset = self->g0_charset; \
|
||||
self->current_charset = 0; \
|
||||
self->utf8_state = 0; \
|
||||
self->utf8_codepoint = 0; \
|
||||
self->use_latin1 = false;
|
||||
@ -245,25 +246,26 @@ void
|
||||
screen_change_charset(Screen *self, uint32_t which) {
|
||||
switch(which) {
|
||||
case 0:
|
||||
self->g_charset = self->g0_charset; break;
|
||||
self->current_charset = 0;
|
||||
self->g_charset = self->g0_charset;
|
||||
break;
|
||||
case 1:
|
||||
self->g_charset = self->g1_charset; break;
|
||||
self->current_charset = 1;
|
||||
self->g_charset = self->g1_charset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
screen_designate_charset(Screen *self, uint32_t which, uint32_t as) {
|
||||
bool change_g = false;
|
||||
switch(which & 1) {
|
||||
switch(which) {
|
||||
case 0:
|
||||
change_g = self->g_charset == self->g0_charset;
|
||||
self->g0_charset = translation_table(as);
|
||||
if (change_g) self->g_charset = self->g0_charset;
|
||||
if (self->current_charset == 0) self->g_charset = self->g0_charset;
|
||||
break;
|
||||
case 1:
|
||||
change_g = self->g_charset == self->g1_charset;
|
||||
self->g1_charset = translation_table(as);
|
||||
if (change_g) self->g_charset = self->g1_charset;
|
||||
if (self->current_charset == 1) self->g_charset = self->g1_charset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -766,7 +768,7 @@ screen_linefeed(Screen *self) {
|
||||
sp->utf8_codepoint = self->utf8_codepoint; \
|
||||
sp->g0_charset = self->g0_charset; \
|
||||
sp->g1_charset = self->g1_charset; \
|
||||
sp->g_charset = self->g_charset; \
|
||||
sp->current_charset = self->current_charset; \
|
||||
sp->use_latin1 = self->use_latin1;
|
||||
|
||||
void
|
||||
@ -800,6 +802,7 @@ screen_restore_cursor(Screen *self) {
|
||||
screen_reset_mode(self, DECSCNM);
|
||||
} else {
|
||||
COPY_CHARSETS(sp, self);
|
||||
self->g_charset = self->current_charset ? self->g1_charset : self->g0_charset;
|
||||
set_mode_from_const(self, DECOM, sp->mDECOM);
|
||||
set_mode_from_const(self, DECAWM, sp->mDECAWM);
|
||||
set_mode_from_const(self, DECSCNM, sp->mDECSCNM);
|
||||
|
||||
@ -30,7 +30,8 @@ typedef struct {
|
||||
#define SAVEPOINTS_SZ 256
|
||||
|
||||
typedef struct {
|
||||
uint32_t utf8_state, utf8_codepoint, *g0_charset, *g1_charset, *g_charset;
|
||||
uint32_t utf8_state, utf8_codepoint, *g0_charset, *g1_charset;
|
||||
unsigned int current_charset;
|
||||
bool use_latin1;
|
||||
Cursor cursor;
|
||||
bool mDECOM, mDECAWM, mDECSCNM;
|
||||
@ -56,6 +57,7 @@ typedef struct {
|
||||
unsigned int columns, lines, margin_top, margin_bottom, charset, scrolled_by, last_selection_scrolled_by;
|
||||
id_type window_id;
|
||||
uint32_t utf8_state, utf8_codepoint, *g0_charset, *g1_charset, *g_charset;
|
||||
unsigned int current_charset;
|
||||
Selection selection;
|
||||
SelectionBoundary last_rendered_selection_start, last_rendered_selection_end, last_rendered_url_start, last_rendered_url_end;
|
||||
Selection url_range;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user