Changeset d625cfd


Ignore:
Timestamp:
May 3, 2010, 9:09:14 PM (10 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
a4bbd80
Parents:
7149832
git-author:
Nelson Elhage <nelhage@mit.edu> (05/01/10 11:51:50)
git-committer:
Nelson Elhage <nelhage@mit.edu> (05/03/10 21:09:14)
Message:
Allow disabling of both automatic wrapping and filling.

In addition, don't force wrapping at the window width unless the user
specifically asked for it.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • editwin.c

    r7149832 rd625cfd  
    4949static int oe_find_display_line(owl_editwin *e, int *x, int index, int *hard);
    5050static void oe_insert_char(owl_editwin *e, gunichar c);
    51 static int owl_editwin_limit_maxcols(int v, int maxv);
     51static int owl_editwin_limit_maxcols(int width, int cols);
    5252static int owl_editwin_check_dotsend(owl_editwin *e);
    5353static int owl_editwin_is_char_in(owl_editwin *e, const char *set);
     
    218218}
    219219
    220 static int owl_editwin_limit_maxcols(int v, int maxv)
    221 {
    222   /* maxv > 5 ? MAX(v, vax) : v */
    223   if (maxv > 5 && v > maxv) {
    224     return(maxv);
    225   } else {
    226     return(v);
    227   }
     220static int owl_editwin_limit_maxcols(int width, int cols)
     221{
     222  if (cols == 0)
     223    return width;
     224  return cols;
    228225}
    229226
     
    11011098  int sentence;
    11021099
     1100  if (e->fillcol < 0)
     1101    /* auto-fill disabled */
     1102    return;
     1103
    11031104  oe_save_excursion(e, &x);
    11041105
     
    12371238    }
    12381239
    1239     if (e->cursorx != -1 && e->cursorx + oe_char_width(c, e->cursorx) > e->wrapcol) {
     1240    if (e->wrapcol > 0 && e->cursorx != -1 &&
     1241        e->cursorx + oe_char_width(c, e->cursorx) > e->wrapcol) {
    12401242      /* XXX this is actually wrong:
    12411243       * + If the line has been been wrapped, we can be past the wrap column but
Note: See TracChangeset for help on using the changeset viewer.