Changeset 5eeea3b


Ignore:
Timestamp:
Aug 17, 2002, 3:23:00 PM (22 years ago)
Author:
Erik Nygren <nygren@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
1354456
Parents:
9bd2c17
Message:
	Modified the behavior of last so that "> >" will clear the screen.
	The new behavior of last is:
	      Moves the pointer to the last message in the view.
	      If we are already at the last message in the view,
	      blanks the screen and moves just past the end of the view
	      so that new messages will appear starting at the top
	      of the screen.
	Fixed a typo in the help for smartzpunt.
	Fixed functions to handle curmsg being past the end of the view.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r9bd2c17 r5eeea3b  
    1616        Switched "C-x C-x" to only "startcommand quit"
    1717        '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
    19281.2.1
    2029        New framework for command handling.
  • commands.c

    r1fd0b25 r5eeea3b  
    155155  OWLCMD_ARGS("smartzpunt", owl_command_smartzpunt, OWL_CTX_INTERACTIVE,
    156156              "creates a zpunt based on the current message",
    157               "smartnarrow [-i | --instance]",
     157              "smartzpunt [-i | --instance]",
    158158              "Starts a zpunt command based on the current message's class\n"
    159159              "(and instance if -i is specified).\n"),
     
    248248
    249249  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"),
    251256  OWLCMD_ALIAS("recv:last", "last"),
    252257
  • functions.c

    r9bd2c17 r5eeea3b  
    375375  v=owl_global_get_current_view(&g);
    376376  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;
    377381
    378382  /* first try to move to an undeleted message in the view*/
     
    389393
    390394    /* if we weren't successful try to find one backwards */
    391     curmsg=owl_global_get_curmsg(&g);
    392395    if (owl_message_is_delete(owl_view_get_element(v, curmsg))) {
    393396      for (i=curmsg; i>0; i--) {
     
    431434
    432435void owl_function_lastmsg_noredisplay() {
    433   int curmsg;
     436  int oldcurmsg, curmsg;
    434437  owl_view *v;
    435438
    436439  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; 
    439442  if (curmsg<0) curmsg=0;
    440443  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  }
    442452  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    443453  owl_global_set_direction_downwards(&g);
     
    631641  v=owl_global_get_current_view(&g);
    632642 
    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) {
    634646    owl_function_makemsg("No current message selected");
    635647    return;
    636648  }
    637649
    638   m=owl_view_get_element(v, owl_global_get_curmsg(&g));
    639650  text=owl_message_get_text(m);
    640651
     
    10561067  v=owl_global_get_current_view(&g);
    10571068 
    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) {
    10591072    owl_function_makemsg("No message selected\n");
    10601073    return;
    10611074  }
    10621075
    1063   m=owl_view_get_element(v, owl_global_get_curmsg(&g));
    10641076  if (!owl_message_is_zephyr(m)) {
    10651077    sprintf(buff,   "Owl Message Id: %i\n", owl_message_get_id(m));
     
    11581170  pw=owl_global_get_popwin(&g);
    11591171
    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) {
    11611175    owl_function_makemsg("No current message");
    11621176    return;
    11631177  }
    11641178
    1165   m=owl_view_get_element(v, owl_global_get_curmsg(&g));
    11661179  owl_function_popless_fmtext(owl_message_get_fmtext(m));
    11671180}
     
    11771190  offset=owl_global_get_curmsg_vert_offset(&g);
    11781191  v=owl_global_get_current_view(&g);
    1179   if (owl_view_get_size(v)==0) return;
    11801192  curmsg=owl_global_get_curmsg(&g);
    11811193  m=owl_view_get_element(v, curmsg);
     1194  if (!m || owl_view_get_size(v)==0) return;
    11821195  lines=owl_message_get_numlines(m);
    11831196
     
    14791492   
    14801493    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
    14811499
    14821500    /* first check if we catch the reply-lockout filter */
     
    19862004  m=owl_view_get_element(v, owl_global_get_curmsg(&g));
    19872005
    1988   if (owl_view_get_size(v)==0) {
     2006  if (!m || owl_view_get_size(v)==0) {
    19892007    owl_function_makemsg("No message selected\n");
    19902008    return NULL;
     
    20332051  m=owl_view_get_element(v, owl_global_get_curmsg(&g));
    20342052
    2035   if (owl_view_get_size(v)==0) {
     2053  if (!m || owl_view_get_size(v)==0) {
    20362054    owl_function_makemsg("No message selected\n");
    20372055    return;
  • mainwin.c

    rf2e36b5 r5eeea3b  
    1010void owl_mainwin_redisplay(owl_mainwin *mw) {
    1111  owl_message *m;
    12   int i, j, p, q, lines, isfull;
     12  int i, p, q, lines, isfull, viewsize;
    1313  int x, y, savey, recwinlines, start;
    1414  int topmsg, curmsg, color;
     
    2727  recwinlines=owl_global_get_recwin_lines(&g);
    2828  topmsg=owl_global_get_topmsg(&g);
     29  viewsize=owl_view_get_size(v);
    2930
    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    }
    3337    mw->curtruncated=0;
    3438    mw->lastdisplayed=-1;
     
    4246  mw->curtruncated=0;
    4347  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++) {
    4650    if (isfull) break;
    4751    m=owl_view_get_element(v, i);
Note: See TracChangeset for help on using the changeset viewer.