mirror of
https://github.com/rfivet/uemacs.git
synced 2024-09-30 01:05:54 -04: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) {
|
void vtinit( void) {
|
||||||
#ifdef SIGWINCH
|
#ifdef SIGWINCH
|
||||||
signal( SIGWINCH, sizesignal) ;
|
signal( SIGWINCH, sizesignal) ;
|
||||||
@ -142,6 +150,7 @@ void vtinit( void) {
|
|||||||
|
|
||||||
setlocale( LC_CTYPE, "") ; /* expects $LANG like en_GB.UTF-8 */
|
setlocale( LC_CTYPE, "") ; /* expects $LANG like en_GB.UTF-8 */
|
||||||
TTopen() ; /* open the screen */
|
TTopen() ; /* open the screen */
|
||||||
|
updmargin() ;
|
||||||
TTkopen() ; /* open the keyboard */
|
TTkopen() ; /* open the keyboard */
|
||||||
TTrev( FALSE) ;
|
TTrev( FALSE) ;
|
||||||
vtalloc( term.t_mrow, term.t_mcol) ;
|
vtalloc( term.t_mrow, term.t_mcol) ;
|
||||||
|
@ -25,6 +25,7 @@ void vtinit( void) ;
|
|||||||
void vtfree( void) ;
|
void vtfree( void) ;
|
||||||
void vttidy( void) ;
|
void vttidy( void) ;
|
||||||
void update( boolean force_f) ;
|
void update( boolean force_f) ;
|
||||||
|
void updmargin( void) ;
|
||||||
void upmode( void) ;
|
void upmode( void) ;
|
||||||
void movecursor( int row, int col) ;
|
void movecursor( int row, int col) ;
|
||||||
void mlerase( void) ;
|
void mlerase( void) ;
|
||||||
|
6
window.c
6
window.c
@ -663,11 +663,7 @@ BBINDABLE( newwidth) {
|
|||||||
|
|
||||||
/* otherwise, just re-width it (no big deal) */
|
/* otherwise, just re-width it (no big deal) */
|
||||||
term.t_ncol = n ;
|
term.t_ncol = n ;
|
||||||
term.t_margin = n / 10 ;
|
updmargin() ;
|
||||||
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) ;
|
|
||||||
|
|
||||||
/* force all windows to redraw */
|
/* force all windows to redraw */
|
||||||
for( window_p wp = wheadp ; wp; wp = wp->w_wndp)
|
for( window_p wp = wheadp ; wp; wp = wp->w_wndp)
|
||||||
|
Loading…
Reference in New Issue
Block a user