Changeset 59cf91c for functions.c


Ignore:
Timestamp:
Aug 17, 2002, 1:21:17 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:
67103d4
Parents:
37c27cf
Message:
	Attempts to stay near the current message when switching views.
	     When switching from an empty view to one we've previously
	     been in, the new current message position will attempt
	     to be close to the current position from the last
	     time we visited that view.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r37c27cf r59cf91c  
    16671667  owl_view *v;
    16681668  owl_filter *f;
     1669  int curid=-1, newpos;
     1670  owl_message *curm;
    16691671
    16701672  v=owl_global_get_current_view(&g);
     1673  curm=owl_view_get_element(v, owl_global_get_curmsg(&g));
     1674  if (curm) {
     1675    curid = owl_message_get_id(curm);
     1676    owl_view_save_curmsgid(v, curid);
     1677  }
     1678
    16711679  f=owl_global_get_filter(&g, filtname);
    16721680  if (!f) {
     
    16781686  owl_view_create(v, f);
    16791687
    1680   owl_global_set_curmsg(&g, 0);
     1688  /* Figure out where to set the current message to.
     1689   * - If the previous view had messages in it, go to the closest message
     1690   *   to the last message in that view.
     1691   * - If the previous view was empty, attempts to restore the position
     1692   *   from the last time we were in that view.  */
     1693  if (curm) {
     1694    newpos = owl_view_get_nearest_to_msgid(v, curid);
     1695  } else {
     1696    newpos = owl_view_get_nearest_to_saved(v);
     1697  }
     1698
     1699  owl_global_set_curmsg(&g, newpos);
     1700
    16811701  owl_global_set_curmsg_vert_offset(&g, 0);
    16821702  owl_global_set_direction_downwards(&g);
Note: See TracChangeset for help on using the changeset viewer.