From 90ef4098f355012c5800c4b3f7f03ce41448a9cc Mon Sep 17 00:00:00 2001 From: piaip Date: Tue, 7 Jun 2005 06:59:18 +0000 Subject: pmore: make wrapmode navigation more accurate when goBottom. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2784 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/pmore.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'mbbsd') diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c index 51ae1375..8c3b45a4 100644 --- a/mbbsd/pmore.c +++ b/mbbsd/pmore.c @@ -43,6 +43,7 @@ #define PMORE_USE_DBCS_WRAP // safer wrap for DBCS. #define PMORE_USE_ASCII_MOVIE // support ascii movie #define PMORE_WORKAROUND_POORTERM // try to work with poor terminal sys +#define PMORE_ACCURATE_WRAPEND // try more harder to find file end in wrap mode #define PMORE_TRADITIONAL_PROMPTEND // when prompt=NA, show only page 1 #define PMORE_TRADITIONAL_FULLCOL // to work with traditional ascii arts @@ -1440,6 +1441,7 @@ pmore(char *fpath, int promptend) { int flExit = 0, retval = 0; int ch = 0; + int invalidate = 1; #ifdef PMORE_USE_ASCII_MOVIE float frameclk = 1.0f; @@ -1471,7 +1473,16 @@ pmore(char *fpath, int promptend) clear(); while(!flExit) { - mf_display(); + if(invalidate) + { + mf_display(); + invalidate = 0; + } + + /* in current implementation, + * we want to invalidate for each keypress. + */ + invalidate = 1; #ifdef PMORE_TRADITIONAL_PROMPTEND if(promptend == NA) // && mf_viewedAll()) @@ -1797,6 +1808,22 @@ pmore(char *fpath, int promptend) case 'G': case KEY_END: mf_goBottom(); + +#ifdef PMORE_ACCURATE_WRAPEND + /* allright. in design of pmore, + * it's possible that when user navigates to file end, + * a wrapped line made nav not 100%. + */ + mf_display(); + invalidate = 0; + + if(!mf_viewedAll()) + { + /* one more try. */ + mf_goBottom(); + invalidate = 1; + } +#endif break; /* Compound Navigation */ -- cgit v1.2.3