diff options
-rw-r--r-- | mbbsd/pmore.c | 31 | ||||
-rw-r--r-- | sample/pttbbs.conf | 2 |
2 files changed, 27 insertions, 6 deletions
diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c index 73eb76c3..56962684 100644 --- a/mbbsd/pmore.c +++ b/mbbsd/pmore.c @@ -386,9 +386,6 @@ mf_determinemaxdisps(int backlines, int update_by_offset) } else mf_backward(backlines); } else { - if( mf.lastpagelines >= 0 && - mf.lastpagelines <= backlines) - return; mf.lineno = backlines; mf.disps = mf.end - 1; backlines = mf_backward(backlines); @@ -1252,6 +1249,14 @@ mf_disp() mf_determinemaxdisps(+1, 1); } else { + /* not caused by seperator? + * ok, then it's by wrapped lines. + * + * old flavor: go bottom: + * mf_determinemaxdisps(0) + * however we have "update" method now, + * so we can achieve more user friendly behavior. + */ mf_determinemaxdisps(+mf.wraplines, 1); } } @@ -1394,6 +1399,7 @@ pmore(char *fpath, int promptend) if(w != 'n') { moviemode = MFDISP_MOVIE_PLAYING; + mf_determinemaxdisps(0, 0); // display until last line mf_movieNextFrame(&frameclk); MFDISP_DIRTY(); continue; @@ -1422,7 +1428,11 @@ pmore(char *fpath, int promptend) if(moviemode == MFDISP_MOVIE_PLAYING) { if(!mf_movieNextFrame(&frameclk)) + { + mf_determinemaxdisps(MFNAV_PAGE, 0); + mf_forward(0); moviemode = MFDISP_MOVIE_YES; // nothing more + } } else if(moviemode == MFDISP_MOVIE_PLAYING_OLD) { @@ -1432,8 +1442,15 @@ pmore(char *fpath, int promptend) PMORE_UINAV_FORWARDPAGE(); } } else { + igetch(); + + /* TODO simple navigation here? */ if(moviemode == MFDISP_MOVIE_PLAYING) + { + mf_determinemaxdisps(MFNAV_PAGE, 0); + mf_forward(0); moviemode = MFDISP_MOVIE_YES; + } else if(moviemode == MFDISP_MOVIE_PLAYING_OLD) moviemode = MFDISP_MOVIE_NO; } @@ -1825,8 +1842,9 @@ pmore(char *fpath, int promptend) */ if(moviemode == MFDISP_MOVIE_YES) { - mf_goTop(); moviemode = MFDISP_MOVIE_PLAYING; + mf_determinemaxdisps(0, 0); // display until last line + mf_goTop(); mf_movieNextFrame(&frameclk); MFDISP_DIRTY(); } @@ -1894,12 +1912,15 @@ pmore_wait_input(float secs) tv.tv_sec = (long) secs; secs -= tv.tv_sec; - tv.tv_usec = (long) (secs * 1000000); + tv.tv_usec = (long) (secs * 1000000L); refresh(); sel = select(1, &readfds, NULL, NULL, &tv); if(sel == 0) return 0; + /* when EINTR, what should we do? + * not pretty sure... + */ /* if(sel < 0 && errno == EINTR) return 0; diff --git a/sample/pttbbs.conf b/sample/pttbbs.conf index 19c06f36..dabecad3 100644 --- a/sample/pttbbs.conf +++ b/sample/pttbbs.conf @@ -119,7 +119,7 @@ //#define HAVE_USERAGREEMENT "etc/UserAgreement" /* 使用新式的 pmore (piaip's more) 代替舊式 bug 抓不完的 more */ -//#define USE_PIAIP_MORE +#define USE_PIAIP_MORE /* 使用 rfork()取代 fork() . 目前只在 FreeBSD上有效 */ //#define USE_RFORK |