Changeset 7c80ea42


Ignore:
Timestamp:
Jun 25, 2011, 2:23:06 AM (13 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Children:
32c331d
Parents:
35849fe
git-author:
Anders Kaseorg <andersk@mit.edu> (06/22/11 03:04:01)
git-committer:
Anders Kaseorg <andersk@mit.edu> (06/25/11 02:23:06)
Message:
history: Tell owl_history_store whether the new entry will be partial

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

Legend:

Unmodified
Added
Removed
  • commands.c

    r57a66fe r7c80ea42  
    26332633  ptr = skiptokens(buff, 1);
    26342634  hist = owl_global_get_cmd_history(&g);
    2635   owl_history_store(hist, ptr);
     2635  owl_history_store(hist, ptr, false);
    26362636  /* owl_function_makemsg("History '%s' stored successfully", ptr+1); */
    26372637  return NULL;
     
    26552655
    26562656  hist = owl_global_get_cmd_history(&g);
    2657   owl_history_store(hist, ptr);
     2657  owl_history_store(hist, ptr, false);
    26582658  return owl_function_command(ptr);
    26592659}
     
    27392739  hist = owl_editwin_get_history(e);
    27402740  if (hist)
    2741     owl_history_store(hist, owl_editwin_get_text(e));
     2741    owl_history_store(hist, owl_editwin_get_text(e), false);
    27422742
    27432743  owl_global_pop_context(&g);
     
    27522752  if (!hist)
    27532753    return;
    2754   if (!owl_history_is_touched(hist)) {
    2755     owl_history_store(hist, owl_editwin_get_text(e));
    2756     owl_history_set_partial(hist);
    2757   }
     2754  if (!owl_history_is_touched(hist))
     2755    owl_history_store(hist, owl_editwin_get_text(e), true);
    27582756  ptr=owl_history_get_prev(hist);
    27592757  if (ptr) {
     
    27942792
    27952793  if (hist)
    2796     owl_history_store(hist, owl_editwin_get_text(e));
     2794    owl_history_store(hist, owl_editwin_get_text(e), false);
    27972795
    27982796  /* Take a reference to the editwin, so that it survives the pop
  • functions.c

    r57a66fe r7c80ea42  
    18391839    if (enter) {
    18401840      owl_history *hist = owl_global_get_cmd_history(&g);
    1841       owl_history_store(hist, buff);
     1841      owl_history_store(hist, buff, false);
    18421842      owl_function_command_norv(buff);
    18431843    } else {
  • history.c

    r35849fe r7c80ea42  
    55  owl_list_create(&(h->hist));
    66  h->cur=0;                     /* current position in history */
    7   h->partial=0;                 /* is the 0th element is partially composed? */
     7  h->partial = false;           /* is the 0th element is partially composed? */
    88}
    99
     
    3636}
    3737
    38 void owl_history_store(owl_history *h, const char *line)
     38void owl_history_store(owl_history *h, const char *line, bool partial)
    3939{
    4040  int size;
     
    5858  /* add the new line */
    5959  owl_list_prepend_element(&(h->hist), g_strdup(line));
    60 }
    61 
    62 void owl_history_set_partial(owl_history *h)
    63 {
    64   if (!h) return;
    65   h->partial=1;
     60  h->partial = partial;
    6661}
    6762
     
    7469    g_free(owl_list_get_element(&(h->hist), 0));
    7570    owl_list_remove_element(&(h->hist), 0);
    76     h->partial = 0;
     71    h->partial = false;
    7772  }
    7873
  • owl.h

    r7086a20 r7c80ea42  
    457457  owl_list hist;
    458458  int cur;
    459   int partial;
     459  bool partial;
    460460} owl_history;
    461461
Note: See TracChangeset for help on using the changeset viewer.