Always refresh window on execution if buffer is displayed, not only on errors.

Insure dot is correct on final !return.
This commit is contained in:
Renaud 2021-09-12 09:34:28 +08:00
parent 8555d07437
commit eff9b64f1d
1 changed files with 9 additions and 8 deletions

17
exec.c
View File

@ -892,8 +892,10 @@ static int dobuf( buffer_p bp) {
lp = returnto->caller ; lp = returnto->caller ;
returnto = returnto->next ; returnto = returnto->next ;
free( cp) ; free( cp) ;
} else } else {
lp = lp->l_fp ;
done = TRUE ; done = TRUE ;
}
} }
break ; break ;
@ -908,9 +910,8 @@ static int dobuf( buffer_p bp) {
break ; break ;
} }
/* check for a command error */ /* refresh window if buffer is displayed */
if( status != TRUE) { if( bp->b_nwnd) {
/* look if buffer is showing */
for( window_p wp = wheadp ; wp != NULL ; wp = wp->w_wndp) { for( window_p wp = wheadp ; wp != NULL ; wp = wp->w_wndp) {
if( wp->w_bufp == bp) { if( wp->w_bufp == bp) {
/* and point it */ /* and point it */
@ -919,11 +920,11 @@ static int dobuf( buffer_p bp) {
wp->w_flag |= WFHARD ; wp->w_flag |= WFHARD ;
} }
} }
}
/* in any case set the buffer . */ /* in any case set the buffer . */
bp->b_dotp = lp ; bp->b_dotp = lp ;
bp->b_doto = 0 ; bp->b_doto = 0 ;
}
freelist( (list_p) returnto) ; freelist( (list_p) returnto) ;
freelist( (list_p) whlist) ; freelist( (list_p) whlist) ;