svn commit: r339529 - head/sys/teken
Poul-Henning Kamp
phk at FreeBSD.org
Sun Oct 21 08:29:38 UTC 2018
Author: phk
Date: Sun Oct 21 08:29:36 2018
New Revision: 339529
URL: https://svnweb.freebsd.org/changeset/base/339529
Log:
Implement ECMA-48 "REP", some Linuxen have started emitting them recently.
Approved by: ed
Modified:
head/sys/teken/gensequences
head/sys/teken/sequences
head/sys/teken/teken.h
head/sys/teken/teken_subr.h
Modified: head/sys/teken/gensequences
==============================================================================
--- head/sys/teken/gensequences Sun Oct 21 07:56:58 2018 (r339528)
+++ head/sys/teken/gensequences Sun Oct 21 08:29:36 2018 (r339529)
@@ -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 "}";
Modified: head/sys/teken/sequences
==============================================================================
--- head/sys/teken/sequences Sun Oct 21 07:56:58 2018 (r339528)
+++ head/sys/teken/sequences Sun Oct 21 08:29:36 2018 (r339529)
@@ -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
Modified: head/sys/teken/teken.h
==============================================================================
--- head/sys/teken/teken.h Sun Oct 21 07:56:58 2018 (r339528)
+++ head/sys/teken/teken.h Sun Oct 21 08:29:36 2018 (r339529)
@@ -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;
Modified: head/sys/teken/teken_subr.h
==============================================================================
--- head/sys/teken/teken_subr.h Sun Oct 21 07:56:58 2018 (r339528)
+++ head/sys/teken/teken_subr.h Sun Oct 21 08:29:36 2018 (r339529)
@@ -796,10 +796,11 @@ teken_subr_primary_device_attributes(const teken_t *t,
}
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;
@@ -1332,3 +1333,12 @@ teken_subr_vertical_position_absolute(teken_t *t, unsi
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);
+}
+
More information about the svn-src-all
mailing list