Changeset 38cc669 for global.c


Ignore:
Timestamp:
Mar 23, 2010, 5:23:43 PM (15 years ago)
Author:
Nelson Elhage <nelhage@ksplice.com>
Branches:
master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
Children:
0d17295
Parents:
8dfb59c
git-author:
Nelson Elhage <nelhage@mit.edu> (03/13/10 23:54:51)
git-committer:
Nelson Elhage <nelhage@ksplice.com> (03/23/10 17:23:43)
Message:
Create/destroy editwins rather than reusing a single one.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    r8dfb59c r38cc669  
    4545  g->rightshift=0;
    4646
    47   g->tw = owl_editwin_allocate();
    48   owl_editwin_init(g->tw, NULL, owl_global_get_typwin_lines(g), g->cols, OWL_EDITWIN_STYLE_ONELINE, NULL);
     47  g->tw = NULL;
    4948
    5049  owl_keyhandler_init(&g->kh);
     
    171170  _owl_panel_set_window(&g->typpan, newwin(typwin_lines, cols, g->recwinlines+2, 0));
    172171
    173   owl_editwin_set_curswin(g->tw, owl_global_get_curs_typwin(g), typwin_lines, g->cols);
     172  if (g->tw)
     173      owl_editwin_set_curswin(g->tw, owl_global_get_curs_typwin(g), typwin_lines, g->cols);
    174174
    175175  idlok(owl_global_get_curs_typwin(g), FALSE);
     
    368368}
    369369
    370 void owl_global_set_typwin_active(owl_global *g) {
    371   int d = owl_global_get_typewindelta(g);
     370void owl_global_set_typwin_active(owl_global *g, int style, owl_history *hist) {
     371  int d;
     372  d = owl_global_get_typewindelta(g);
    372373  if (d > 0)
    373374      owl_function_resize_typwin(owl_global_get_typwin_lines(g) + d);
    374375
     376  g->tw = owl_editwin_new(owl_global_get_curs_typwin(g),
     377                          owl_global_get_typwin_lines(g),
     378                          g->cols,
     379                          style,
     380                          hist);
    375381  g->typwinactive=1;
    376382}
     
    382388
    383389  g->typwinactive=0;
     390
     391  owl_editwin_delete(g->tw);
     392  werase(owl_global_get_curs_typwin(g));
     393  g->tw = NULL;
    384394}
    385395
     
    513523  owl_mainwin_redisplay(&(g->mw));
    514524  sepbar(NULL);
    515   owl_editwin_redisplay(g->tw);
     525  if (g->tw)
     526      owl_editwin_redisplay(g->tw);
    516527  owl_function_full_redisplay();
    517528
Note: See TracChangeset for help on using the changeset viewer.