Weird matching brace block selection when caret is in a string inside parentheses (fixed)

Weird matching brace block selection when caret is in a string inside parentheses (fixed)

25
Basic UserBasic User
25

    Mar 09, 2017#1

    Hi, block selection behaves well, except for strings inside ( ) and some cases of multi-line strings
    Do you think my settings are flawed, or is it working that way at your place, too?

    Switch to SQL language highlighting. PLSQL wordfile settings:

    /Open Brace Strings = "("
    /Close Brace Strings = ")"

    Code: Select all

    select ((((( select max(123) as ctr_b_here_is_ok from dual ))))) as ok from dual
    ;
    
    select 1 as not_ok from dual
    where (dummy in ('ctr_b_over_following_comma_is_ok', 'ctrl+B inside string here selects block after this line'))
      OR  (dummy > (select max('ctr_b_left_or_right_from_this_string_is_ok') from dual))
    ;
    
    select '
    (((
    ((aaaaaaaa ''ctr_b_here_is_ok''))
    )))' as klammerstring_ok  from dual
    ;
    
    select '(((
    ((aaaaaaaa ''ctr_b_here_selects_up_to_this_line_only_and_ignores_rest_of_file''))
    )))
    ' as klammerstring_not_ok  from dual
    ;
    
    select '(((((aaaaaaaa ''ctrl+B inside string here selects block in following line, ok so'')))))' as klammerstr from dual
    ;
    
    select ((((( ctr_b_here_is_ok))))) as ok from (select 1234 as ctr_b_here_is_ok from dual)
    ;
    /* Switch to C/C++ language highlighting, experience is the about the same: */

    Code: Select all

    {
      {
        s = "ctr_b_here_is_ok";
        s = "sadf(asdf,asdf)ctr_b_here_is_ok_too";
        s = "sadf{ asdf } ctr_b_here_is_ok_too";
      }
    }
    {
        f( "ctr_b_over_following_comma_is_ok", "ctrl+B inside string here selects block after this line");
        g(ctr_b_here_is_ok, ctr_b_here_is_ok, ctr_b_here_is_ok)
        h( "ctrl+B inside string here selects nothing
        ctr_b_here_is_ok",
        "ctrl+B inside string here selects nothing
        ()
        bad
        ctrl+B inside string here selects block after this line");
        s = "ctr_b_here_is_ok";
        c = 'a'; // ok
        n = ((a+ctr_b_here_is_ok)*(c+d))/2;
        s = "ctr_b_here_is_ok";n = ((a+ctr_b_here_is_ok)*(ctr_b_here_is_ok+d))/2;
        c = 'a'; n = ((a+ctr_b_here_is_ok)*(c+d))/2;
    }
    
    Regards from Vienna

    6,675585
    Grand MasterGrand Master
    6,675585

      Mar 10, 2017#2

      I can see the same Select to Matching Brace behavior as you using UltraEdit v22.20.0.49 on Windows XP and of course also with UE v24.00.0.53 on Windows 7.

      Interesting for me was to see that changing the line

      Code: Select all

      f( "ctr_b_over_following_comma_is_ok", "ctrl+B inside string here selects block after this line");
      to

      Code: Select all

      f( "ctr_b_over_following_comma_is_ok", "ctrl+B inside string here selects block after this line"
      );
      by hitting key RETURN before closing parenthesis and pressing Ctrl+B with caret inside second string results in matching the block from opening parenthesis after f to closing parenthesis on next line.

      But pressing Ctrl+B inside the second string with closing parenthesis on same line always selects the block after g on next line independent on what exists between end of second string and ) for f(...) statement. That is really weird and should be reported to IDM support by email (not done by me).
      Best regards from an UC/UE/UES for Windows user from Austria

      25
      Basic UserBasic User
      25

        Mar 16, 2017#3

        Bug report e-mail sent to IDM
        1/ block selection (to Brace pair) behaves well, except for strings inside ( ) and some cases of multi-line strings.
        + examples from above post
        2/ “Select to Matching Brace” does not exist as an option in the context menu nor in the main menu Edit/Select
        Regards from Vienna

        6,675585
        Grand MasterGrand Master
        6,675585

          Mar 16, 2017#4

          Thanks for reporting the select to matching brace issue.

          The command is Search - Select to matching brace on using traditional menus available since UE for Windows v23.20 and UEStudio v16.20.

          The command is Coding - Select to brace on using contemporary menus (UE v23.00+ and UES v16.00+).

          In ribbon mode the command is also Coding - Select to brace (UE v23.00+ and UES v16.00+).

          The document window context menu is customizable since UE or Windows v24.00 and UES v17.00 like it was prior UE v23.00 and UES v16.00. The command Select to brace from category Coding can be added by every user to the context menu.

            Jan 24, 2019#5

            Hi Miklos,

            All reproducible issues described by you are fixed with UltraEdit for Windows v25.20.0.156 and UEStudio v18.20.0.40 according to my tests.
            Best regards from an UC/UE/UES for Windows user from Austria