Commit 9bdc5f75 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Implement and test ECMA-48 "REP" sequence.

Fixes: #2668
parent 0b965793
......@@ -158,6 +158,7 @@ for (p in l_prefix_name) {
if (l_prefix_name[p] != "teken_state_init") {
print "";
print "\tt->t_last = 0;";
print "\tteken_state_switch(t, teken_state_init);";
}
print "}";
......
......@@ -114,3 +114,6 @@ C25VTSW Cons25 switch virtual terminal ^[ [ z r
# VT52 compatibility
#DECID VT52 DECID ^[ Z
# ECMA-48
REP Repeat last graphic char ^[ [ b n
......@@ -157,6 +157,7 @@ struct __teken {
unsigned int t_utf8_left;
teken_char_t t_utf8_partial;
teken_char_t t_last;
unsigned int t_curscs;
teken_scs_t *t_saved_curscs;
......
......@@ -798,10 +798,11 @@ teken_subr_primary_device_attributes(const teken_t *t, unsigned int request)
}
static void
teken_subr_do_putchar(const teken_t *t, const teken_pos_t *tp, teken_char_t c,
teken_subr_do_putchar(teken_t *t, const teken_pos_t *tp, teken_char_t c,
int width)
{
t->t_last = c;
if (t->t_stateflags & TS_INSERT &&
tp->tp_col < t->t_winsize.tp_col - width) {
teken_rect_t ctr;
......@@ -1334,3 +1335,12 @@ teken_subr_vertical_position_absolute(teken_t *t, unsigned int row)
t->t_stateflags &= ~TS_WRAPPED;
teken_funcs_cursor(t);
}
static void
teken_subr_repeat_last_graphic_char(teken_t *t, unsigned int rpts)
{
for (; t->t_last != 0 && rpts > 0; rpts--)
teken_subr_regular_character(t, t->t_last);
}
......@@ -204,6 +204,27 @@ process p4 -writehex 0d
process p4 -expect-text 21 11 "Enter choice number (0 - 12):"
process p4 -screen_dump
# 11. Test non-VT100 (e.g., VT220, XTERM) terminals
process p4 -writehex "31 31 0d"
process p4 -expect-text 0 0 "Menu 11: Non-VT100 Tests"
process p4 -writehex "37 0d"
process p4 -expect-text 0 0 "Menu 11.7: Miscellaneous ISO-6429 (ECMA-48) Tests"
process p4 -writehex "32 0d"
process p4 -expect-text 0 0 "Push <RETURN>"
process p4 -screen_dump
process p4 -expect-text 20 1 "Test Repeat (REP)"
process p4 -expect-text 1 1 " ++ "
process p4 -expect-text 2 2 " ++ "
process p4 -expect-text 17 17 " ++ "
process p4 -expect-text 18 18 "*++*"
process p4 -writehex "0d"
process p4 -expect-text 0 0 "Menu 11.7: Miscellaneous ISO-6429 (ECMA-48) Tests"
process p4 -writehex "30 0d"
process p4 -expect-text 0 0 "Menu 11: Non-VT100 Tests"
process p4 -writehex "30 0d"
# 0. Exit
process p4 -writehex "30 0d"
process p4 -expect-text 12 30 "That's all, folks!"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment