# HG changeset patch # User Eli Zaretskii # Date 948724887 0 # Node ID 4df4f3866b55326b45db0a20ed2fbf03da6dd583 # Parent 155a79b2cb98765969998022bbd7b06518195291 (IT_menu_display): Truncate long menu lines at the right screen boundary. diff -r 155a79b2cb98 -r 4df4f3866b55 src/msdos.c --- a/src/msdos.c Sun Jan 23 22:20:24 2000 +0000 +++ b/src/msdos.c Mon Jan 24 14:41:27 2000 +0000 @@ -3268,6 +3268,8 @@ IT_update_begin (sf); for (i = 0; i < menu->count; i++) { + int max_width = width + 2; + IT_cursor_to (y + i, x); enabled = (!menu->submenu[i] && menu->panenumber[i]) || (menu->submenu[i]); @@ -3292,13 +3294,18 @@ p++; } } - - for (; j < width; j++, p++) + /* Don't let the menu text overflow into the next screen row. */ + if (x + max_width > screen_size_X) + { + max_width = screen_size_X - x; + text[max_width - 1].u.ch = '$'; /* indicate it's truncated */ + } + for (; j < max_width - 2; j++, p++) SET_CHAR_GLYPH (*p, ' ', face, 0); SET_CHAR_GLYPH (*p, menu->submenu[i] ? 16 : ' ', face, 0); p++; - IT_write_glyphs (text, width + 2); + IT_write_glyphs (text, max_width); } IT_update_end (sf); IT_cursor_to (row, col);