Changeset 57a66fe


Ignore:
Timestamp:
Jun 25, 2011, 2:12:43 AM (6 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Children:
35849fe
Parents:
7086a20
git-author:
Anders Kaseorg <andersk@mit.edu> (06/22/11 02:54:44)
git-committer:
Anders Kaseorg <andersk@mit.edu> (06/25/11 02:12:43)
Message:
history: Make owl_history_store also reset

It doesn’t make sense to run owl_history_store without
owl_history_reset (except in one case where we know the current
position is already the beginning and we’re about to
owl_history_set_partial), so let’s merge these functions.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r58f4fb2 r57a66fe  
    26342634  hist = owl_global_get_cmd_history(&g);
    26352635  owl_history_store(hist, ptr);
    2636   owl_history_reset(hist);
    26372636  /* owl_function_makemsg("History '%s' stored successfully", ptr+1); */
    26382637  return NULL;
     
    26572656  hist = owl_global_get_cmd_history(&g);
    26582657  owl_history_store(hist, ptr);
    2659   owl_history_reset(hist);
    26602658  return owl_function_command(ptr);
    26612659}
     
    27402738
    27412739  hist = owl_editwin_get_history(e);
    2742   if (hist) {
     2740  if (hist)
    27432741    owl_history_store(hist, owl_editwin_get_text(e));
    2744     owl_history_reset(hist);
    2745   }
    27462742
    27472743  owl_global_pop_context(&g);
     
    27972793  owl_history *hist=owl_editwin_get_history(e);
    27982794
    2799   if (hist) {
     2795  if (hist)
    28002796    owl_history_store(hist, owl_editwin_get_text(e));
    2801     owl_history_reset(hist);
    2802   }
    28032797
    28042798  /* Take a reference to the editwin, so that it survives the pop
  • functions.c

    r58f4fb2 r57a66fe  
    18401840      owl_history *hist = owl_global_get_cmd_history(&g);
    18411841      owl_history_store(hist, buff);
    1842       owl_history_reset(hist);
    18431842      owl_function_command_norv(buff);
    18441843    } else {
  • history.c

    r7086a20 r57a66fe  
    4949  }
    5050
     51  owl_history_reset(h);
     52
    5153  /* check if the line is the same as the last */
    5254  if (owl_list_get_size(&(h->hist))>0) {
Note: See TracChangeset for help on using the changeset viewer.