From c42f0f9a458d9f3c8d0b6afbd330e9ef97121eb5 Mon Sep 17 00:00:00 2001 From: Eric Oulashin <eric.oulashin@gmail.com> Date: Sat, 1 Mar 2025 13:15:01 -0800 Subject: [PATCH] DDLightbarMenu: For numbered mode (no lightbar), allow 1 mor character when using substr with the item text --- exec/load/dd_lightbar_menu.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exec/load/dd_lightbar_menu.js b/exec/load/dd_lightbar_menu.js index b0ffd3dfd0..9a9b04a6c0 100644 --- a/exec/load/dd_lightbar_menu.js +++ b/exec/load/dd_lightbar_menu.js @@ -1090,8 +1090,10 @@ function DDLightbarMenu_Draw(pSelectedItemIndexes, pDrawBorders, pDrawScrollbar, var showMultiSelectMark = (this.multiSelect && (typeof(pSelectedItemIndexes) == "object") && pSelectedItemIndexes.hasOwnProperty(idx)); var itemText = this.GetItemText(i, itemLen, false, showMultiSelectMark); // TODO: Once, it seemed the text must be shortened by 3 less than the console width or else - // it behaves like there's an extra CRLF, but 2 should be correct. - console.print(substrWithAttrCodes(itemText, 0, console.screen_columns-2) + "\x01n"); + // it behaves like there's an extra CRLF. 2 seemed correct, but that can cut off a character + // when not desired. + //console.print(substrWithAttrCodes(itemText, 0, console.screen_columns-2) + "\x01n"); + console.print(substrWithAttrCodes(itemText, 0, console.screen_columns-1) + "\x01n"); console.crlf(); } this.numberedMode = numberedModeBackup; -- GitLab