Changeset 83a079a


Ignore:
Timestamp:
Jun 25, 2011, 3:24:36 AM (13 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
ad37b39
Parents:
9923144
git-author:
Anders Kaseorg <andersk@mit.edu> (06/22/11 02:54:44)
git-committer:
Anders Kaseorg <andersk@mit.edu> (06/25/11 03:24:36)
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

    rd427f08 r83a079a  
    26332633  hist = owl_global_get_cmd_history(&g);
    26342634  owl_history_store(hist, ptr);
    2635   owl_history_reset(hist);
    26362635  /* owl_function_makemsg("History '%s' stored successfully", ptr+1); */
    26372636  return NULL;
     
    26562655  hist = owl_global_get_cmd_history(&g);
    26572656  owl_history_store(hist, ptr);
    2658   owl_history_reset(hist);
    26592657  return owl_function_command(ptr);
    26602658}
     
    27392737
    27402738  hist = owl_editwin_get_history(e);
    2741   if (hist) {
     2739  if (hist)
    27422740    owl_history_store(hist, owl_editwin_get_text(e));
    2743     owl_history_reset(hist);
    2744   }
    27452741
    27462742  owl_global_pop_context(&g);
     
    27962792  owl_history *hist=owl_editwin_get_history(e);
    27972793
    2798   if (hist) {
     2794  if (hist)
    27992795    owl_history_store(hist, owl_editwin_get_text(e));
    2800     owl_history_reset(hist);
    2801   }
    28022796
    28032797  /* Take a reference to the editwin, so that it survives the pop
  • functions.c

    r8b293ea r83a079a  
    18421842      owl_history *hist = owl_global_get_cmd_history(&g);
    18431843      owl_history_store(hist, buff);
    1844       owl_history_reset(hist);
    18451844      owl_function_command_norv(buff);
    18461845    } else {
  • history.c

    r9923144 r83a079a  
    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.