svn commit: r257431 - in user/ed/newcons/sys: kern teken
Aleksandr Rybalko
ray at FreeBSD.org
Thu Oct 31 09:44:49 UTC 2013
Author: ray
Date: Thu Oct 31 09:44:48 2013
New Revision: 257431
URL: http://svnweb.freebsd.org/changeset/base/257431
Log:
Add teken_subr_do_resize new method, to update taken sizes w/o reset positions
and use it in case we update terminal size not touching existing data.
Sponsored by: The FreeBSD Foundation
Modified:
user/ed/newcons/sys/kern/subr_terminal.c
user/ed/newcons/sys/teken/teken.c
user/ed/newcons/sys/teken/teken.h
user/ed/newcons/sys/teken/teken_subr.h
Modified: user/ed/newcons/sys/kern/subr_terminal.c
==============================================================================
--- user/ed/newcons/sys/kern/subr_terminal.c Thu Oct 31 09:29:37 2013 (r257430)
+++ user/ed/newcons/sys/kern/subr_terminal.c Thu Oct 31 09:44:48 2013 (r257431)
@@ -201,11 +201,7 @@ terminal_set_winsize_blank(struct termin
TERMINAL_LOCK(tm);
if (blank == 0)
- /*
- * Assigned directly, to avoid terminal reset in the
- * teken_set_winsize.
- */
- tm->tm_emulator.t_winsize = r.tr_end;
+ teken_set_winsize_noreset(&tm->tm_emulator, &r.tr_end);
else
teken_set_winsize(&tm->tm_emulator, &r.tr_end);
TERMINAL_UNLOCK(tm);
Modified: user/ed/newcons/sys/teken/teken.c
==============================================================================
--- user/ed/newcons/sys/teken/teken.c Thu Oct 31 09:29:37 2013 (r257430)
+++ user/ed/newcons/sys/teken/teken.c Thu Oct 31 09:44:48 2013 (r257431)
@@ -347,6 +347,14 @@ teken_set_winsize(teken_t *t, const teke
}
void
+teken_set_winsize_noreset(teken_t *t, const teken_pos_t *p)
+{
+
+ t->t_winsize = *p;
+ teken_subr_do_resize(t);
+}
+
+void
teken_set_8bit(teken_t *t)
{
Modified: user/ed/newcons/sys/teken/teken.h
==============================================================================
--- user/ed/newcons/sys/teken/teken.h Thu Oct 31 09:29:37 2013 (r257430)
+++ user/ed/newcons/sys/teken/teken.h Thu Oct 31 09:44:48 2013 (r257431)
@@ -168,6 +168,7 @@ void teken_set_cursor(teken_t *, const t
void teken_set_curattr(teken_t *, const teken_attr_t *);
void teken_set_defattr(teken_t *, const teken_attr_t *);
void teken_set_winsize(teken_t *, const teken_pos_t *);
+void teken_set_winsize_noreset(teken_t *, const teken_pos_t *);
/* Key input escape sequences. */
#define TKEY_UP 0x00
Modified: user/ed/newcons/sys/teken/teken_subr.h
==============================================================================
--- user/ed/newcons/sys/teken/teken_subr.h Thu Oct 31 09:29:37 2013 (r257430)
+++ user/ed/newcons/sys/teken/teken_subr.h Thu Oct 31 09:44:48 2013 (r257431)
@@ -956,6 +956,15 @@ teken_subr_reset_mode(teken_t *t, unsign
}
static void
+teken_subr_do_resize(teken_t *t)
+{
+
+ t->t_scrollreg.ts_begin = 0;
+ t->t_scrollreg.ts_end = t->t_winsize.tp_row;
+ t->t_originreg = t->t_scrollreg;
+}
+
+static void
teken_subr_do_reset(teken_t *t)
{
More information about the svn-src-user
mailing list