Changeset 1fd0b25 for commands.c


Ignore:
Timestamp:
Aug 17, 2002, 10:31:35 AM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
37c27cf
Parents:
8509c08
Message:
Added the 'search' command.
'/' is a keybinding for 'search'
'?' is a keybinding for 'search -r'
Fixed stristr, which was completely broken
renamed owl_fmtext_ztext_stylestrip to owl_function_ztext_styletsrip
     and put it in functions.c
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    rf2e36b5 r1fd0b25  
    497497              "returns the value of a variable",
    498498              "getvar <varname>", ""),
     499
     500  OWLCMD_ARGS("search", owl_command_search, OWL_CTX_INTERACTIVE,
     501              "search messages for a particular string",
     502              "search [-r] [<string>]",
     503              "The search command will find messages that contain the\n"
     504              "specified string and move the cursor there.  If no string\n"
     505              "argument is supplied then the previous one is used.  By\n"
     506              "default searches are done fowards, if -r is used the search\n"
     507              "is performed backwards"),
    499508
    500509  /****************************************************************/
     
    14781487}
    14791488
     1489char *owl_command_search(int argc, char **argv, char *buff) {
     1490  int direction;
     1491  char *buffstart;
     1492
     1493  direction=OWL_DIRECTION_DOWNWARDS;
     1494  buffstart=skiptokens(buff, 1);
     1495  if (argc>1 && !strcmp(argv[1], "-r")) {
     1496    direction=OWL_DIRECTION_UPWARDS;
     1497    buffstart=skiptokens(buff, 2);
     1498  }
     1499   
     1500  if (argc==1 || (argc==2 && !strcmp(argv[1], "-r"))) {
     1501    owl_function_search_continue(direction);
     1502  } else {
     1503    owl_function_search_start(buffstart, direction);
     1504  }
     1505 
     1506  return(NULL);
     1507}
     1508
    14801509/*********************************************************************/
    14811510/************************** EDIT SPECIFIC ****************************/
Note: See TracChangeset for help on using the changeset viewer.