Permalink
Browse files

Always disable wrapping in single-line editwins.

  • Loading branch information...
1 parent 4d9e425 commit 9d7a7205d6c9cbea0e8999e4c350440f8ef5fef8 @nelhage committed May 4, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 editwin.c
View
@@ -124,12 +124,12 @@ static void _owl_editwin_init(owl_editwin *e,
e->cursorx = -1;
e->topindex = 0;
e->excursions = NULL;
- owl_editwin_set_curswin(e, win, winlines, wincols);
e->style=style;
if ((style!=OWL_EDITWIN_STYLE_MULTILINE) &&
(style!=OWL_EDITWIN_STYLE_ONELINE)) {
e->style=OWL_EDITWIN_STYLE_MULTILINE;
}
+ owl_editwin_set_curswin(e, win, winlines, wincols);
e->lock=0;
e->dotsend=0;
e->echochar='\0';
@@ -151,7 +151,10 @@ void owl_editwin_set_curswin(owl_editwin *e, WINDOW *w, int winlines, int wincol
e->winlines=winlines;
e->wincols=wincols;
e->fillcol=owl_editwin_limit_maxcols(wincols-7, owl_global_get_edit_maxfillcols(&g));
- e->wrapcol=owl_editwin_limit_maxcols(wincols-7, owl_global_get_edit_maxwrapcols(&g));
+ if (e->style == OWL_EDITWIN_STYLE_MULTILINE)
+ e->wrapcol=owl_editwin_limit_maxcols(wincols-7, owl_global_get_edit_maxwrapcols(&g));
+ else
+ e->wrapcol = 0;
}
/* echo the character 'ch' for each normal character keystroke,

0 comments on commit 9d7a720

Please sign in to comment.