Changeset 5934b87


Ignore:
Timestamp:
Mar 23, 2010, 5:23:43 PM (10 years ago)
Author:
Nelson Elhage <nelhage@ksplice.com>
Branches:
master, release-1.6, release-1.7, release-1.8, release-1.9
Children:
59ab8dd
Parents:
d83621c4
git-author:
Nelson Elhage <nelhage@ksplice.com> (03/06/10 17:54:44)
git-committer:
Nelson Elhage <nelhage@ksplice.com> (03/23/10 17:23:43)
Message:
Merge editline:done with edit:done as well.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    rd83621c4 r5934b87  
    906906                  "", ""),
    907907
    908   OWLCMD_VOID_CTX("editline:done", owl_command_editline_done,
    909                   OWL_CTX_EDITLINE,
    910                   "completes the command (eg, executes command being composed)",
    911                   "", ""),
    912 
     908  OWLCMD_ALIAS   ("editline:done", "edit:done"),
    913909  OWLCMD_ALIAS   ("editresponse:done", "edit:done"),
    914910
     
    27502746}
    27512747
    2752 void owl_command_editline_done(owl_editwin *e)
    2753 {
    2754   owl_history *hist=owl_editwin_get_history(e);
    2755   char *rv, *cmd;
    2756 
    2757   owl_history_store(hist, owl_editwin_get_text(e));
    2758   owl_history_reset(hist);
    2759   cmd = owl_strdup(owl_editwin_get_text(e));
    2760 
    2761   owl_global_set_typwin_inactive(&g);
    2762   owl_editwin_delete(e);
    2763   owl_global_pop_context(&g);
    2764 
    2765   rv = owl_function_command(cmd);
    2766   owl_free(cmd);
    2767 
    2768   owl_global_set_needrefresh(&g);
    2769 
    2770   if (rv) {
    2771     owl_function_makemsg("%s", rv);
    2772     owl_free(rv);
    2773   }
    2774 }
    2775 
    2776 
    27772748void owl_command_edit_done(owl_editwin *e)
    27782749{
  • functions.c

    rd83621c4 r5934b87  
    19001900}
    19011901
     1902void owl_callback_command(owl_editwin *e)
     1903{
     1904  char *rv;
     1905  const char *line = owl_editwin_get_text(e);
     1906
     1907  rv = owl_function_command(line);
     1908   if (rv) {
     1909    owl_function_makemsg("%s", rv);
     1910    owl_free(rv);
     1911  }
     1912}
     1913
    19021914void owl_function_start_command(const char *line)
    19031915{
     
    19141926
    19151927  owl_global_push_context(&g, OWL_CTX_EDITLINE, tw, "editline");
     1928  owl_editwin_set_callback(tw, owl_callback_command);
    19161929}
    19171930
Note: See TracChangeset for help on using the changeset viewer.