Changeset 9c1e61d4
- Timestamp:
- Sep 18, 2010, 5:07:40 PM (14 years ago)
- Branches:
- master, release-1.10, 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)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
ra728387 r9c1e61d4 2538 2538 2539 2539 if (argc==1 || (argc==2 && !strcmp(argv[1], "-r"))) { 2540 owl_function_search_helper( 1, direction);2540 owl_function_search_helper(OWL_SEARCH_CONTINUE, direction); 2541 2541 } else { 2542 2542 owl_function_set_search(buffstart); 2543 owl_function_search_helper( 0, direction);2543 owl_function_search_helper(OWL_SEARCH_MATCH_CURRENT, direction); 2544 2544 } 2545 2545 -
functions.c
ra728387 r9c1e61d4 2904 2904 * OWL_DIRECTION_UPWARDS then search backwards. 2905 2905 * 2906 * If mode ==0 then it will stay on the current message if it2907 * c ontains the string.2906 * If mode is OWL_SEARCH_MATCH_CURRENT then it will stay on the 2907 * current message if it contains the string. 2908 2908 */ 2909 2909 … … 2921 2921 } 2922 2922 2923 if (mode ==0) {2923 if (mode == OWL_SEARCH_MATCH_CURRENT) { 2924 2924 start=curmsg; 2925 2925 } else if (direction==OWL_DIRECTION_DOWNWARDS) { -
owl.h
r09ceee3 r9c1e61d4 138 138 #define OWL_DIRECTION_DOWNWARDS 1 139 139 #define OWL_DIRECTION_UPWARDS 2 140 141 #define OWL_SEARCH_MATCH_CURRENT 0 142 #define OWL_SEARCH_CONTINUE 1 140 143 141 144 #define OWL_LOGGING_DIRECTION_BOTH 0 -
viewwin.c
r09ceee3 r9c1e61d4 300 300 * found. 301 301 * 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. 303 304 */ 304 305 int owl_viewwin_search(owl_viewwin *v, const owl_regex *re, int mode, int direction) … … 309 310 owl_fmtext_line_extents(&v->fmtext, v->topline, &start, &end); 310 311 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); 312 314 if (offset < 0) 313 315 return 0; … … 321 323 * them. */ 322 324 buf = owl_fmtext_get_text(&v->fmtext); 323 lineend = mode? start : end;325 lineend = (mode == OWL_SEARCH_CONTINUE) ? start : end; 324 326 while (lineend > 0) { 325 327 linestartp = memrchr(buf, '\n', lineend - 1);
Note: See TracChangeset
for help on using the changeset viewer.