Changeset 52172cc for editwin.c


Ignore:
Timestamp:
Sep 30, 2010, 8:07:17 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
58a16cc
Parents:
e75a6df
git-author:
David Benjamin <davidben@mit.edu> (09/29/10 14:04:30)
git-committer:
David Benjamin <davidben@mit.edu> (09/30/10 20:07:17)
Message:
Update the editwin's fillcol and wrapcol on resize

Otherwise resizing the window during the lifetime of an editwin will not
pick up changes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • editwin.c

    re75a6df r52172cc  
    170170}
    171171
    172 static void oe_window_resized(owl_window *w, owl_editwin *e)
    173 {
    174   /* update the sizes */
    175   owl_window_get_position(w, &e->winlines, &e->wincols, NULL, NULL);
    176 }
    177 
    178 static void oe_set_window(owl_editwin *e, owl_window *w, int winlines, int wincols)
    179 {
    180   e->win=w;
     172/* TODO: collapse this window into oe_window_resized. Need to stop
     173 * passing winlines and wincols to oe_set_window and get them out of
     174 * the owl_window. The tester code will first need to pass in an
     175 * owl_window headless or so. */
     176static void oe_set_window_size(owl_editwin *e, int winlines, int wincols)
     177{
    181178  e->winlines=winlines;
    182179  e->wincols=wincols;
     180  /* fillcol and wrapcol may have changed. */
    183181  e->fillcol=owl_editwin_limit_maxcols(wincols-7, owl_global_get_edit_maxfillcols(&g));
    184182  if (e->style == OWL_EDITWIN_STYLE_MULTILINE)
     
    186184  else
    187185    e->wrapcol = 0;
     186}
     187
     188static void oe_window_resized(owl_window *w, owl_editwin *e)
     189{
     190  int winlines, wincols;
     191  owl_window_get_position(w, &winlines, &wincols, NULL, NULL);
     192  oe_set_window_size(e, winlines, wincols);
     193}
     194
     195static void oe_set_window(owl_editwin *e, owl_window *w, int winlines, int wincols)
     196{
     197  e->win=w;
     198  oe_set_window_size(e, winlines, wincols);
    188199  if (e->win) {
    189200    g_object_ref(e->win);
Note: See TracChangeset for help on using the changeset viewer.