Changeset 5eeea3b
- Timestamp:
- Aug 17, 2002, 3:23:00 PM (21 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 1354456
- Parents:
- 9bd2c17
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r9bd2c17 r5eeea3b 16 16 Switched "C-x C-x" to only "startcommand quit" 17 17 'getsubs' prints closer to the order you sub in. 18 18 Modified the behavior of last so that "> >" will clear the screen. 19 The new behavior of last is: 20 Moves the pointer to the last message in the view. 21 If we are already at the last message in the view, 22 blanks the screen and moves just past the end of the view 23 so that new messages will appear starting at the top 24 of the screen. 25 Fixed a typo in the help for smartzpunt. 26 Fixed functions to handle curmsg being past the end of the view. 27 19 28 1.2.1 20 29 New framework for command handling. -
commands.c
r1fd0b25 r5eeea3b 155 155 OWLCMD_ARGS("smartzpunt", owl_command_smartzpunt, OWL_CTX_INTERACTIVE, 156 156 "creates a zpunt based on the current message", 157 "smart narrow[-i | --instance]",157 "smartzpunt [-i | --instance]", 158 158 "Starts a zpunt command based on the current message's class\n" 159 159 "(and instance if -i is specified).\n"), … … 248 248 249 249 OWLCMD_VOID("last", owl_command_last, OWL_CTX_INTERACTIVE, 250 "move the pointer to the last message", "", ""), 250 "move the pointer to the last message", "", 251 "Moves the pointer to the last message in the view.\n" 252 "If we are already at the last message in the view,\n" 253 "blanks the screen and moves just past the end of the view\n" 254 "so that new messages will appear starting at the top\n" 255 "of the screen.\n"), 251 256 OWLCMD_ALIAS("recv:last", "last"), 252 257 -
functions.c
r9bd2c17 r5eeea3b 375 375 v=owl_global_get_current_view(&g); 376 376 ml=owl_global_get_msglist(&g); 377 378 /* just check to make sure we're in bounds... */ 379 if (curmsg>owl_view_get_size(v)-1) curmsg=owl_view_get_size(v)-1; 380 if (curmsg<0) curmsg=0; 377 381 378 382 /* first try to move to an undeleted message in the view*/ … … 389 393 390 394 /* if we weren't successful try to find one backwards */ 391 curmsg=owl_global_get_curmsg(&g);392 395 if (owl_message_is_delete(owl_view_get_element(v, curmsg))) { 393 396 for (i=curmsg; i>0; i--) { … … 431 434 432 435 void owl_function_lastmsg_noredisplay() { 433 int curmsg;436 int oldcurmsg, curmsg; 434 437 owl_view *v; 435 438 436 439 v=owl_global_get_current_view(&g); 437 438 curmsg=owl_view_get_size(v)-1; 440 oldcurmsg=owl_global_get_curmsg(&g); 441 curmsg=owl_view_get_size(v)-1; 439 442 if (curmsg<0) curmsg=0; 440 443 owl_global_set_curmsg(&g, curmsg); 441 owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS); 444 if (oldcurmsg < curmsg) { 445 owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS); 446 } else if (curmsg<owl_view_get_size(v)) { 447 /* If already at the end, blank the screen and move curmsg 448 * past the end of the messages. */ 449 owl_global_set_topmsg(&g, curmsg+1); 450 owl_global_set_curmsg(&g, curmsg+1); 451 } 442 452 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 443 453 owl_global_set_direction_downwards(&g); … … 631 641 v=owl_global_get_current_view(&g); 632 642 633 if (owl_view_get_size(v)==0) { 643 m=owl_view_get_element(v, owl_global_get_curmsg(&g)); 644 645 if (!m || owl_view_get_size(v)==0) { 634 646 owl_function_makemsg("No current message selected"); 635 647 return; 636 648 } 637 649 638 m=owl_view_get_element(v, owl_global_get_curmsg(&g));639 650 text=owl_message_get_text(m); 640 651 … … 1056 1067 v=owl_global_get_current_view(&g); 1057 1068 1058 if (owl_view_get_size(v)==0) { 1069 m=owl_view_get_element(v, owl_global_get_curmsg(&g)); 1070 1071 if (!m || owl_view_get_size(v)==0) { 1059 1072 owl_function_makemsg("No message selected\n"); 1060 1073 return; 1061 1074 } 1062 1075 1063 m=owl_view_get_element(v, owl_global_get_curmsg(&g));1064 1076 if (!owl_message_is_zephyr(m)) { 1065 1077 sprintf(buff, "Owl Message Id: %i\n", owl_message_get_id(m)); … … 1158 1170 pw=owl_global_get_popwin(&g); 1159 1171 1160 if (owl_view_get_size(v)==0) { 1172 m=owl_view_get_element(v, owl_global_get_curmsg(&g)); 1173 1174 if (!m || owl_view_get_size(v)==0) { 1161 1175 owl_function_makemsg("No current message"); 1162 1176 return; 1163 1177 } 1164 1178 1165 m=owl_view_get_element(v, owl_global_get_curmsg(&g));1166 1179 owl_function_popless_fmtext(owl_message_get_fmtext(m)); 1167 1180 } … … 1177 1190 offset=owl_global_get_curmsg_vert_offset(&g); 1178 1191 v=owl_global_get_current_view(&g); 1179 if (owl_view_get_size(v)==0) return;1180 1192 curmsg=owl_global_get_curmsg(&g); 1181 1193 m=owl_view_get_element(v, curmsg); 1194 if (!m || owl_view_get_size(v)==0) return; 1182 1195 lines=owl_message_get_numlines(m); 1183 1196 … … 1479 1492 1480 1493 m=owl_view_get_element(owl_global_get_current_view(&g), owl_global_get_curmsg(&g)); 1494 if (!m) { 1495 owl_function_makemsg("No message selected"); 1496 return; 1497 } 1498 1481 1499 1482 1500 /* first check if we catch the reply-lockout filter */ … … 1986 2004 m=owl_view_get_element(v, owl_global_get_curmsg(&g)); 1987 2005 1988 if ( owl_view_get_size(v)==0) {2006 if (!m || owl_view_get_size(v)==0) { 1989 2007 owl_function_makemsg("No message selected\n"); 1990 2008 return NULL; … … 2033 2051 m=owl_view_get_element(v, owl_global_get_curmsg(&g)); 2034 2052 2035 if ( owl_view_get_size(v)==0) {2053 if (!m || owl_view_get_size(v)==0) { 2036 2054 owl_function_makemsg("No message selected\n"); 2037 2055 return; -
mainwin.c
rf2e36b5 r5eeea3b 10 10 void owl_mainwin_redisplay(owl_mainwin *mw) { 11 11 owl_message *m; 12 int i, j, p, q, lines, isfull;12 int i, p, q, lines, isfull, viewsize; 13 13 int x, y, savey, recwinlines, start; 14 14 int topmsg, curmsg, color; … … 27 27 recwinlines=owl_global_get_recwin_lines(&g); 28 28 topmsg=owl_global_get_topmsg(&g); 29 viewsize=owl_view_get_size(v); 29 30 30 /* if there are no messages, just draw a blank screen */ 31 if (owl_view_get_size(v)==0) { 32 owl_global_set_topmsg(&g, 0); 31 /* if there are no messages or if topmsg is past the end of the messages, 32 * just draw a blank screen */ 33 if (viewsize==0 || topmsg>=viewsize) { 34 if (viewsize==0) { 35 owl_global_set_topmsg(&g, 0); 36 } 33 37 mw->curtruncated=0; 34 38 mw->lastdisplayed=-1; … … 42 46 mw->curtruncated=0; 43 47 mw->lasttruncated=0; 44 j=owl_view_get_size(v); 45 for (i=topmsg; i< j; i++) {48 49 for (i=topmsg; i<viewsize; i++) { 46 50 if (isfull) break; 47 51 m=owl_view_get_element(v, i);
Note: See TracChangeset
for help on using the changeset viewer.