Changeset b470451
- Timestamp:
- Jun 25, 2011, 3:24:36 AM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 8e515f9
- Parents:
- ad37b39
- git-author:
- Anders Kaseorg <andersk@mit.edu> (06/22/11 03:04:01)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (06/25/11 03:24:36)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
r83a079a rb470451 2632 2632 ptr = skiptokens(buff, 1); 2633 2633 hist = owl_global_get_cmd_history(&g); 2634 owl_history_store(hist, ptr );2634 owl_history_store(hist, ptr, false); 2635 2635 /* owl_function_makemsg("History '%s' stored successfully", ptr+1); */ 2636 2636 return NULL; … … 2654 2654 2655 2655 hist = owl_global_get_cmd_history(&g); 2656 owl_history_store(hist, ptr );2656 owl_history_store(hist, ptr, false); 2657 2657 return owl_function_command(ptr); 2658 2658 } … … 2738 2738 hist = owl_editwin_get_history(e); 2739 2739 if (hist) 2740 owl_history_store(hist, owl_editwin_get_text(e) );2740 owl_history_store(hist, owl_editwin_get_text(e), false); 2741 2741 2742 2742 owl_global_pop_context(&g); … … 2751 2751 if (!hist) 2752 2752 return; 2753 if (!owl_history_is_touched(hist)) { 2754 owl_history_store(hist, owl_editwin_get_text(e)); 2755 owl_history_set_partial(hist); 2756 } 2753 if (!owl_history_is_touched(hist)) 2754 owl_history_store(hist, owl_editwin_get_text(e), true); 2757 2755 ptr=owl_history_get_prev(hist); 2758 2756 if (ptr) { … … 2793 2791 2794 2792 if (hist) 2795 owl_history_store(hist, owl_editwin_get_text(e) );2793 owl_history_store(hist, owl_editwin_get_text(e), false); 2796 2794 2797 2795 /* Take a reference to the editwin, so that it survives the pop -
functions.c
r83a079a rb470451 1841 1841 if (enter) { 1842 1842 owl_history *hist = owl_global_get_cmd_history(&g); 1843 owl_history_store(hist, buff );1843 owl_history_store(hist, buff, false); 1844 1844 owl_function_command_norv(buff); 1845 1845 } else { -
history.c
rad37b39 rb470451 5 5 owl_list_create(&(h->hist)); 6 6 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? */ 8 8 } 9 9 … … 36 36 } 37 37 38 void owl_history_store(owl_history *h, const char *line )38 void owl_history_store(owl_history *h, const char *line, bool partial) 39 39 { 40 40 int size; … … 58 58 /* add the new line */ 59 59 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; 66 61 } 67 62 … … 74 69 g_free(owl_list_get_element(&(h->hist), 0)); 75 70 owl_list_remove_element(&(h->hist), 0); 76 h->partial = 0;71 h->partial = false; 77 72 } 78 73 -
owl.h
r9923144 rb470451 457 457 owl_list hist; 458 458 int cur; 459 intpartial;459 bool partial; 460 460 } owl_history; 461 461
Note: See TracChangeset
for help on using the changeset viewer.