Changeset b6cf72f for viewwin.c


Ignore:
Timestamp:
Sep 18, 2010, 5:07:40 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
d2fd2f7
Parents:
9c1e61d
git-author:
David Benjamin <davidben@mit.edu> (08/15/10 19:42:43)
git-committer:
David Benjamin <davidben@mit.edu> (09/18/10 17:07:40)
Message:
FINALLY! Add a popless:search command

That took a while.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • viewwin.c

    r9c1e61d rb6cf72f  
    140140  }
    141141  wattroff(curswin, A_REVERSE);
     142}
     143
     144char *owl_viewwin_command_search(owl_viewwin *v, int argc, const char *const *argv, const char *buff)
     145{
     146  int direction, mode;
     147  const char *buffstart;
     148
     149  direction=OWL_DIRECTION_DOWNWARDS;
     150  buffstart=skiptokens(buff, 1);
     151  if (argc>1 && !strcmp(argv[1], "-r")) {
     152    direction=OWL_DIRECTION_UPWARDS;
     153    buffstart=skiptokens(buff, 2);
     154  }
     155
     156  if (argc==1 || (argc==2 && !strcmp(argv[1], "-r"))) {
     157    mode = OWL_SEARCH_CONTINUE;
     158  } else {
     159    owl_function_set_search(buffstart);
     160    mode = OWL_SEARCH_MATCH_CURRENT;
     161  }
     162
     163  if (!owl_viewwin_search(v, owl_global_get_search_re(&g), mode, direction))
     164    owl_function_error("No more matches");
     165  return NULL;
    142166}
    143167
Note: See TracChangeset for help on using the changeset viewer.