Changeset 10b866d for commands.c


Ignore:
Timestamp:
Jul 8, 2002, 10:37:21 PM (18 years ago)
Author:
Erik Nygren <nygren@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
e1c4636
Parents:
8df36cc
Message:
* Fixed preservation of e->dotsend across owl_editwin_clear().

* Added history for multiline edit windows (eg, for zephyr composition).
  The M-n and M-p keys will cycle through the history ring.
  In particular, it is now possible to edit the command line
  of a zephyr being composed:  C-c it and restart it
  and then M-p to get the aborted composition back.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r8df36cc r10b866d  
    593593
    594594  OWLCMD_VOID_CTX("edit:history-next", owl_command_edit_history_next,
    595                   OWL_CTX_EDITLINE,
     595                  OWL_CTX_EDIT,
    596596                  "replaces the text with the previous history",
    597597                  "", ""),
    598598
    599599  OWLCMD_VOID_CTX("edit:history-prev", owl_command_edit_history_prev,
    600                   OWL_CTX_EDITLINE,
     600                  OWL_CTX_EDIT,
    601601                  "replaces the text with the previous history",
    602602                  "", ""),
     
    14781478
    14791479void owl_command_edit_cancel(owl_editwin *e) {
     1480  owl_history *hist;
     1481
    14801482  owl_function_makemsg("Command cancelled.");
     1483
     1484  hist=owl_editwin_get_history(e);
     1485  owl_history_store(hist, owl_editwin_get_text(e));
     1486  owl_history_reset(hist);
     1487
    14811488  owl_editwin_fullclear(e);
    14821489  owl_global_set_needrefresh(&g);
    14831490  wnoutrefresh(owl_editwin_get_curswin(e));
    14841491  owl_global_set_typwin_inactive(&g);
    1485   owl_editwin_new_style(e, OWL_EDITWIN_STYLE_ONELINE);
     1492  owl_editwin_new_style(e, OWL_EDITWIN_STYLE_ONELINE, NULL);
    14861493}
    14871494
     
    14901497  char *ptr;
    14911498
    1492   hist=owl_global_get_history(&g);
     1499  hist=owl_editwin_get_history(e);
    14931500  if (!owl_history_is_touched(hist)) {
    14941501    owl_history_store(hist, owl_editwin_get_text(e));
     
    15101517  char *ptr;
    15111518
    1512   hist=owl_global_get_history(&g);
     1519  hist=owl_editwin_get_history(e);
    15131520  ptr=owl_history_get_next(hist);
    15141521  if (ptr) {
     
    15311538
    15321539void owl_command_editline_done(owl_editwin *e) {
    1533   owl_history *hist=owl_global_get_history(&g);
     1540  owl_history *hist=owl_editwin_get_history(e);
    15341541  char *rv, *cmd;
    15351542
    1536   owl_global_set_typwin_inactive(&g);
    15371543  owl_history_store(hist, owl_editwin_get_text(e));
    15381544  owl_history_reset(hist);
     1545  owl_global_set_typwin_inactive(&g);
    15391546  cmd = owl_strdup(owl_editwin_get_text(e));
    15401547  owl_editwin_fullclear(e);
     
    15521559
    15531560void owl_command_editmulti_done(owl_editwin *e) {
     1561  owl_history *hist=owl_editwin_get_history(e);
     1562
     1563  owl_history_store(hist, owl_editwin_get_text(e));
     1564  owl_history_reset(hist);
     1565
    15541566  owl_function_run_buffercommand();
    1555   owl_editwin_new_style(e, OWL_EDITWIN_STYLE_ONELINE);
     1567  owl_editwin_new_style(e, OWL_EDITWIN_STYLE_ONELINE, NULL);
    15561568  owl_editwin_fullclear(e);
    15571569  owl_global_set_typwin_inactive(&g);
Note: See TracChangeset for help on using the changeset viewer.