diff options
-rw-r--r-- | CHANGES | 6 | ||||
-rw-r--r-- | lynx.man | 6 | ||||
-rw-r--r-- | src/GridText.c | 29 | ||||
-rw-r--r-- | src/HTML.c | 4 | ||||
-rw-r--r-- | src/LYCurses.c | 3 | ||||
-rw-r--r-- | src/LYMainLoop.c | 57 |
6 files changed, 68 insertions, 37 deletions
diff --git a/CHANGES b/CHANGES index e611a253..1aa4dba1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,11 @@ --- $LynxId: CHANGES,v 1.568 2012/02/04 00:56:27 tom Exp $ +-- $LynxId: CHANGES,v 1.569 2012/02/05 19:14:53 tom Exp $ =============================================================================== Changes since Lynx 2.8 release =============================================================================== -2012-02-03 (2.8.8dev.10) +2012-02-05 (2.8.8dev.10) +* modify comparison for splitting lines to allow for long preformatted lines, + e.g., using 's to not wrap when the line-wrap mode is disabled -TD * modify cfg2html.pl to handle options which contain a digit, e.g., HTML5_CHARSETS whose default value was not marked properly -TD * modify HTLoadDocument() to not retain a cached document if user is explicitly diff --git a/lynx.man b/lynx.man index f72b4dee..9666ed59 100644 --- a/lynx.man +++ b/lynx.man @@ -1,4 +1,4 @@ -.\" $LynxId: lynx.man,v 1.89 2010/09/27 10:49:29 tom Exp $ +.\" $LynxId: lynx.man,v 1.90 2012/02/05 19:09:07 tom Exp $ .nr N -1 .nr D 5 .TH LYNX 1 @@ -250,6 +250,10 @@ but to the standard output. .B \-curses_pads toggles the use of curses "pad" feature which supports left/right scrolling of the display. +The feature is normally available for curses configurations, +but inactive. +To activate it, use the "|" character or the LINEWRAP_TOGGLE command. +Toggling this option makes the feature altogether unavailable. .TP .B \-debug_partial separate incremental display stages with MessageSecs delay diff --git a/src/GridText.c b/src/GridText.c index 1e381bc7..2d13c02f 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -1,5 +1,5 @@ /* - * $LynxId: GridText.c,v 1.218 2012/02/03 01:27:52 tom Exp $ + * $LynxId: GridText.c,v 1.220 2012/02/05 21:39:18 tom Exp $ * * Character grid hypertext object * =============================== @@ -2850,6 +2850,7 @@ static void split_line(HText *text, unsigned split) #ifdef DEBUG_APPCH CTRACE((tfp, "GridText: split_line(%p,%d) called\n", text, split)); + CTRACE((tfp, " previous=%s\n", previous->data)); CTRACE((tfp, " bold_on=%d, underline_on=%d\n", bold_on, underline_on)); #endif @@ -4309,20 +4310,32 @@ void HText_appendCharacter(HText *text, int ch) /* * Check for end of line. + * + * Notes: + * 1) text->permissible_split is nonzero if we found a place to split the + * line. If there is no such place, we still will wrap at the display + * limits (the comparison against LYcols_cu). Furthermore, if the + * curses-pads feature is active, we will ignore the first comparison + * (against WRAP_COLS) to allow wide preformatted text to be displayed + * without wrapping. + * 2) ctrl_chars_on_this_line are nonprintable bytes used for formatting. */ actual = ((indent + (int) line->offset + (int) line->size) + ((line->size > 0) && - (int) (line->data[line->size - 1] == LY_SOFT_HYPHEN ? 1 : 0))); + (int) (line->data[line->size - 1] == LY_SOFT_HYPHEN ? 1 : 0)) + - ctrl_chars_on_this_line); - if ((actual - + (int) style->rightIndent - - ctrl_chars_on_this_line - + ((IS_CJK_TTY && text->kanji_buf) ? 1 : 0) - ) >= WRAP_COLS(text) + if (((text->permissible_split +#ifdef USE_CURSES_PADS + || !LYwideLines +#endif + ) && (actual + + (int) style->rightIndent + + ((IS_CJK_TTY && text->kanji_buf) ? 1 : 0) + ) >= WRAP_COLS(text)) || (text->T.output_utf8 && ((actual + UTFXTRA_ON_THIS_LINE - - ctrl_chars_on_this_line + UTF_XLEN(ch) ) > (LYcols_cu(text) - 1)))) { diff --git a/src/HTML.c b/src/HTML.c index 9b492fc5..c932f4c3 100644 --- a/src/HTML.c +++ b/src/HTML.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTML.c,v 1.152 2011/12/01 01:45:47 tom Exp $ + * $LynxId: HTML.c,v 1.153 2012/02/05 22:23:51 tom Exp $ * * Structured stream to Rich hypertext converter * ============================================ @@ -4781,7 +4781,7 @@ static int HTML_start_element(HTStructured * me, int element_number, */ I.value = ImageSrc; } else if (I.value == 0) { - StrAllocCopy(I.value, " "); + StrAllocCopy(I.value, ""); } if (present && present[HTML_INPUT_READONLY]) I.readonly = YES; diff --git a/src/LYCurses.c b/src/LYCurses.c index 2c73528c..13f7eff5 100644 --- a/src/LYCurses.c +++ b/src/LYCurses.c @@ -1,4 +1,4 @@ -/* $LynxId: LYCurses.c,v 1.161 2011/10/07 00:39:43 tom Exp $ */ +/* $LynxId: LYCurses.c,v 1.162 2012/02/05 14:53:36 tom Exp $ */ #include <HTUtils.h> #include <HTAlert.h> @@ -1306,6 +1306,7 @@ void start_curses(void) #ifdef USE_CURSES_PADS if (LYuseCursesPads) { + CTRACE((tfp, "using curses-pads\n")); LYwin = newpad(LYlines, MAX_COLS); LYshiftWin = 0; LYwideLines = FALSE; diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index 39015918..e3066998 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYMainLoop.c,v 1.179 2012/02/01 00:05:07 tom Exp $ + * $LynxId: LYMainLoop.c,v 1.181 2012/02/05 19:04:59 tom Exp $ */ #include <HTUtils.h> #include <HTAccess.h> @@ -5289,30 +5289,41 @@ static BOOLEAN handle_LYK_LINEWRAP_TOGGLE(int *cmd, 3 }; int c; + int code = FALSE; + + CTRACE((tfp, "Entering handle_LYK_LINEWRAP_TOGGLE\n")); + if (LYwin != stdscr) { + /* Somehow the mouse is over the number instead of being over the + name, so we decrease x. */ + c = LYChoosePopup(!LYwideLines, + LYlines / 2 - 2, + LYcolLimit / 2 - 6, + choices, (int) TABLESIZE(choices) - 1, + FALSE, TRUE); + /* + * LYhandlePopupList() wasn't really meant to be used outside of + * old-style Options menu processing. One result of mis-using it here + * is that we have to deal with side-effects regarding SIGINT signal + * handler and the term_options global variable. - kw + */ + if (!term_options) { + CTRACE((tfp, + "...setting LYwideLines %d, LYtableCols %d (have %d and %d)\n", + c, wrap[c], + LYwideLines, + LYtableCols)); - if (LYwin == stdscr) - return FALSE; - - /* Somehow the mouse is over the number instead of being over the - name, so we decrease x. */ - c = LYChoosePopup(!LYwideLines, LYlines / 2 - 2, LYcolLimit / 2 - 6, - choices, (int) TABLESIZE(choices) - 1, FALSE, TRUE); - /* - * LYhandlePopupList() wasn't really meant to be used outside of old-style - * Options menu processing. One result of mis-using it here is that we - * have to deal with side-effects regarding SIGINT signal handler and the - * term_options global variable. - kw - */ - if (term_options) - return FALSE; - LYwideLines = c; - LYtableCols = wrap[c]; + LYwideLines = c; + LYtableCols = wrap[c]; - if (LYwideLines == 0) - LYshiftWin = 0; - *flag = TRUE; - HTUserMsg(LYwideLines ? LINEWRAP_OFF : LINEWRAP_ON); - return reparse_or_reload(cmd); + if (LYwideLines == 0) + LYshiftWin = 0; + *flag = TRUE; + HTUserMsg(LYwideLines ? LINEWRAP_OFF : LINEWRAP_ON); + code = reparse_or_reload(cmd); + } + } + return code; } #endif |