robotframework / RIDE

Test data editor for Robot Framework
Apache License 2.0
951 stars 375 forks source link

[Text Editor] Lost indentation for "Run Keywords" with multiple "AND"s in the For loop #2790

Closed ZDabrowski closed 3 weeks ago

ZDabrowski commented 1 month ago

Lost indentation of the "Run Keywords" with multiple "AND"s inside the FOR loop after saving changes in Text Editor or after reloading Test Suite with "Open Directory".

Environment: Python 3.10.12 wxPython 4.2.1 robotframework 6.0.2 robotframework-ride 2.1.dev45 Ubuntu 22.04.4 LTS

Steps

  1. Prepare a FOR loop using GUI: obraz
  2. Switch to Text Edit tab: obraz
  3. Modify argument and save file: obraz
  4. Run test: obraz

Additional info Sample of working code:

*** Test Cases ***
test_case2
    FOR    ${idx}    IN    1    2    3
        Run Keywords    keyword1    ccc
        ...    AND    keyword2    ccc
        ...    AND    keyword3    ccc
    END

*** Keywords ***
keyword1
    [Arguments]    ${arg1}
    LOG    first ${arg1}    WARN

keyword2
    [Arguments]    ${arg1}
    LOG    second ${arg1}    WARN

keyword3
    [Arguments]    ${arg1}
    LOG    third ${arg1}    WARN

Did not notice any traceback on the console during this operation.

HelioGuilherme66 commented 1 month ago

@ZDabrowski Thanks for the report. If you write in a single line and Save, the reformatting is OK, but on next Apply/Save becomes broken, This kind of reformatting bugs in Text Editor are a PITA :(