• UB of the IDLE editor

    From Stefan Ram@3:633/280.2 to All on Sat Feb 24 02:17:58 2024
    UB = undesirable behavior

    Undesirable behavior of the IDLE editor

    With my version of IDLE under Windows, I observe the following
    behavior:

    I assume that the editor window contains some non-empty line:

    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccccccccccccc|cccccccccccc dddddddddddddddddddddddddddddddddddddddddddd

    . The cursor "|" is at the 32nd position of the third line.
    Now, I press "shift-home" and the positions up to 31 of the
    third line will be selected:

    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ###############################ccccccccccccc dddddddddddddddddddddddddddddddddddddddddddd

    ("#" means "a selected c".)

    So far, this is what I would expect.

    Now, I press "shift-right" (i.e., "shift-right arrow"
    or "shift-cursor right") to exclude the first c from the
    selection. The expected result is:

    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb c##############################ccccccccccccc dddddddddddddddddddddddddddddddddddddddddddd

    . I believe all other Windows editors behave this way, so
    I got used to it and use it to select text with as little
    keystrokes as possible.

    But with my version of IDLE, this behavior does not always occur!,
    instead sometimes, unexpectedly, text from other lines is selected
    when "shift-right" is pressed in this situation.

    I wonder if someone can understand my expectation and also
    observe the behavior of IDLE which I have described.

    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: Stefan Ram (3:633/280.2@fidonet)