• Issue with UIFC list

    From Michael Long@VERT to GitLab issue in main/sbbs on Wed Feb 10 04:26:06 2021
    open https://gitlab.synchro.net/main/sbbs/-/issues/218

    The up/down arrow keys are behaving incorrectly in UIFC. The list is not redrawing properly.

    Example script:
    ```javascript
    "use strict"
    load("sbbsdefs.js");
    load("uifcdefs.js");

    uifc.init();

    var ctx = new uifc.list.CTX();

    var menuTitles = [];
    menuTitles.push("test1");
    menuTitles.push("test2");
    menuTitles.push("test3");
    menuTitles.push("test4");
    menuTitles.push("-----");

    var selection = uifc.list(WIN_SAV, "Testing", menuTitles, ctx);
    uifc.bail();
    writeln("selected " + selection);
    ```

    Possibly caused by the commits on January 29

    https://gitlab.synchro.net/main/sbbs/-/commit/e5cdc9a55602778b821dfc101407367fa3df1ef3

    https://gitlab.synchro.net/main/sbbs/-/commit/4f087081761db61dc49813d4ad90aba9c1402c5c

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Thu Feb 11 02:58:37 2021
    https://gitlab.synchro.net/main/sbbs/-/issues/218#note_1570

    So I think there's at least 2 issues here. First, this line in `js_uifc.c` seems suspect:
    ```
    p->bar = INT_MAX;
    ```
    We want the bar to default to 0 (the top of the list), not the bottom of the list.

    But still, leaving this value at INT_MAX is a good test of the cur/bar value checking logic in uifc32.c:ulist().

    Given the test script, `i` on line 930 becomes `-4` and the following `if()` condition is not executed, so from that point on, `bar` and `cur` are out of sync and strange stuff happens.

    Initializing `p->bar` to 0 in `js_uifc.c` makes this test script look/work fine, but the out-of-range `bar` value correction in uifc32.c's `ulist()` is clearly still broken.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Michael Long@VERT to GitLab note in main/sbbs on Thu Feb 11 03:02:56 2021
    https://gitlab.synchro.net/main/sbbs/-/issues/218#note_1571

    We want the bar to default to 0 (the top of the list), not the bottom of the list.

    Actually, based on this commit, I think deuce wanted to move it to default to the bottom:

    https://gitlab.synchro.net/main/sbbs/-/commit/2da95710623d330a22af766de18696763cba5f50

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Thu Feb 11 03:04:09 2021
    https://gitlab.synchro.net/main/sbbs/-/issues/218#note_1573

    I don't think that was the intention.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to GitLab issue in main/sbbs on Fri Feb 12 02:53:06 2021
    close https://gitlab.synchro.net/main/sbbs/-/issues/218

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net