Changeset 12c35df for history.c


Ignore:
Timestamp:
Oct 28, 2003, 7:56:35 PM (17 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:
cee1f25
Parents:
faf71b5
Message:
Fixed replies to loopback messages
Fixed smartnarrow on classes/instances with spaces
Don't allow duplicates in command history
Added the 'loggingdirection' variable
All loopback messages log to 'loopback' now
Print an error message if trying an invalid color for a filter
Fixed bug causing > not to go to end of editwin every time
File:
1 edited

Legend:

Unmodified
Added
Removed
  • history.c

    r70b53ec r12c35df  
    99  h->touched=0;                 /* whether we've gone into history */
    1010  h->partial=0;                 /* is the 0th element is partially composed? */
     11  h->repeats=1;                 /* by default we'll allow repeat entries */
     12}
     13
     14void owl_history_set_norepeats(owl_history *h)
     15{
     16  h->repeats=0;
    1117}
    1218
     
    4248void owl_history_store(owl_history *h, char *line)
    4349{
    44   int size;
     50  int i, size;
    4551
    4652  if (!h) return;
     53  size=owl_list_get_size(&(h->hist));
     54
     55  /* if repeats are disallowed, check if the line is present already */
     56  for (i=0; i<size; i++) {
     57    if (!strcmp(line, owl_list_get_element(&(h->hist), i))) return;
     58  }
    4759
    4860  /* if partial is set, remove the first entry first */
     
    5264
    5365  /* if we've reached the max history size, pop off the last element */
    54   size=owl_list_get_size(&(h->hist));
    5566  if (size>OWL_HISTORYSIZE) {
    5667    owl_free(owl_list_get_element(&(h->hist), size-1));
Note: See TracChangeset for help on using the changeset viewer.