diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-10 14:44:50 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-10 14:44:50 +0800 |
commit | 48cb8baf4e3df5d263c87fc152fdf38dc9e6e439 (patch) | |
tree | abc9aed4bd285f59767a8f798bc200a92fde187e /mbbsd | |
parent | af72ae1e0a95561a00e0980650b4f2bf32201ba2 (diff) | |
download | pttbbs-48cb8baf4e3df5d263c87fc152fdf38dc9e6e439.tar pttbbs-48cb8baf4e3df5d263c87fc152fdf38dc9e6e439.tar.gz pttbbs-48cb8baf4e3df5d263c87fc152fdf38dc9e6e439.tar.bz2 pttbbs-48cb8baf4e3df5d263c87fc152fdf38dc9e6e439.tar.lz pttbbs-48cb8baf4e3df5d263c87fc152fdf38dc9e6e439.tar.xz pttbbs-48cb8baf4e3df5d263c87fc152fdf38dc9e6e439.tar.zst pttbbs-48cb8baf4e3df5d263c87fc152fdf38dc9e6e439.zip |
- pfterm: handle X position better.
warning: \n at eol (>=cols) will now create one blank line.
such case should be handled by pager, not terminal system.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3813 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/pfterm.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/mbbsd/pfterm.c b/mbbsd/pfterm.c index 88a2b2b4..701ef21e 100644 --- a/mbbsd/pfterm.c +++ b/mbbsd/pfterm.c @@ -940,11 +940,8 @@ getmaxyx(int *y, int *x) void move(int y, int x) { - y = ranged(y, 0, ft.rows-1); - x = ranged(x, 0, ft.cols-1); - - ft.y = y; - ft.x = x; + ft.y = ranged(y, 0, ft.rows-1); + ft.x = ranged(x, 0, ft.cols-1); } // scrolling @@ -1183,6 +1180,15 @@ outc(unsigned char c) } else // normal characters { + assert (ft.x >= 0 && ft.x < ft.cols); + + // normal characters + FTC = c; +#ifdef FTATTR_TRANSPARENT + if (ft.attr != FTATTR_TRANSPARENT) +#endif // FTATTR_TRANSPARENT + FTA = ft.attr; + // XXX allow x == ft.cols? if (ft.x >= ft.cols) { @@ -1196,17 +1202,6 @@ outc(unsigned char c) ft.y --; } } - - // normal characters - FTC = c; -#ifdef FTATTR_TRANSPARENT - if (ft.attr != FTATTR_TRANSPARENT) -#endif // FTATTR_TRANSPARENT - FTA = ft.attr; - ft.x ++; - - // we must carefully deal x here. - ft.x = ranged(ft.x, 0, ft.cols-1); } } |