mirror of
https://github.com/rfivet/uemacs.git
synced 2024-11-12 23:56:51 -05:00
Fix initialization of screen margin and scroll size.
This commit is contained in:
parent
0cb1799786
commit
f010d63a95
@ -135,6 +135,14 @@ static void vtalloc( int maxrow, int maxcol) {
|
||||
}
|
||||
}
|
||||
|
||||
void updmargin( void) {
|
||||
term.t_margin = term.t_ncol / 10 ;
|
||||
if( term.t_margin < 3) /* t_margin - 1 enough for $ + prev before current */
|
||||
term.t_margin = 3 ;
|
||||
|
||||
term.t_scrsiz = term.t_ncol - 2 * term.t_margin ;
|
||||
}
|
||||
|
||||
void vtinit( void) {
|
||||
#ifdef SIGWINCH
|
||||
signal( SIGWINCH, sizesignal) ;
|
||||
@ -142,6 +150,7 @@ void vtinit( void) {
|
||||
|
||||
setlocale( LC_CTYPE, "") ; /* expects $LANG like en_GB.UTF-8 */
|
||||
TTopen() ; /* open the screen */
|
||||
updmargin() ;
|
||||
TTkopen() ; /* open the keyboard */
|
||||
TTrev( FALSE) ;
|
||||
vtalloc( term.t_mrow, term.t_mcol) ;
|
||||
|
@ -25,6 +25,7 @@ void vtinit( void) ;
|
||||
void vtfree( void) ;
|
||||
void vttidy( void) ;
|
||||
void update( boolean force_f) ;
|
||||
void updmargin( void) ;
|
||||
void upmode( void) ;
|
||||
void movecursor( int row, int col) ;
|
||||
void mlerase( void) ;
|
||||
|
6
window.c
6
window.c
@ -663,11 +663,7 @@ BBINDABLE( newwidth) {
|
||||
|
||||
/* otherwise, just re-width it (no big deal) */
|
||||
term.t_ncol = n ;
|
||||
term.t_margin = n / 10 ;
|
||||
if( term.t_margin < 3) /* t_margin -1 enough for $ + prev before current */
|
||||
term.t_margin = 3 ;
|
||||
|
||||
term.t_scrsiz = n - (term.t_margin * 2) ;
|
||||
updmargin() ;
|
||||
|
||||
/* force all windows to redraw */
|
||||
for( window_p wp = wheadp ; wp; wp = wp->w_wndp)
|
||||
|
Loading…
Reference in New Issue
Block a user