Changeset 9c1e61d 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:
b6cf72f
Parents:
a728387
git-author:
David Benjamin <davidben@mit.edu> (08/15/10 19:40:03)
git-committer:
David Benjamin <davidben@mit.edu> (09/18/10 17:07:40)
Message:
Add OWL_SEARCH_CONTINUE and OWL_SEARCH_MATCH_CURRENT

Instead of having a confusing mode argument, define more constants.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • viewwin.c

    r09ceee3 r9c1e61d  
    300300 * found.
    301301 *
    302  * If mode==0 then stay on the current line if it matches.
     302 * If mode is OWL_SEARCH_MATCH_CURRENT then stay on the current line
     303 * if it matches.
    303304 */
    304305int owl_viewwin_search(owl_viewwin *v, const owl_regex *re, int mode, int direction)
     
    309310  owl_fmtext_line_extents(&v->fmtext, v->topline, &start, &end);
    310311  if (direction == OWL_DIRECTION_DOWNWARDS) {
    311     offset = owl_fmtext_search(&v->fmtext, re, mode ? end : start);
     312    offset = owl_fmtext_search(&v->fmtext, re,
     313                               (mode == OWL_SEARCH_CONTINUE) ? end : start);
    312314    if (offset < 0)
    313315      return 0;
     
    321323     * them. */
    322324    buf = owl_fmtext_get_text(&v->fmtext);
    323     lineend = mode ? start : end;
     325    lineend = (mode == OWL_SEARCH_CONTINUE) ? start : end;
    324326    while (lineend > 0) {
    325327      linestartp = memrchr(buf, '\n', lineend - 1);
Note: See TracChangeset for help on using the changeset viewer.