bugGNU Octave - Bugs: bug #51321, end keyword used as index disrupts...

 
 

bug #51321: end keyword used as index disrupts code folding

Submitter:  Marshall <marsian>
Submitted:  Mon 26 Jun 2017 11:09:25 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  lostbard
Originator Name:  Marsian Open/Closed:  * Closed
Release:  * 4.2.1 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 15 Jul 2017 12:52:28 PM UTC, comment #5: 

closing as fixed for mxe. The upstream fix will slowly make its way into qscintilla

John Donoghue <lostbard>
Group Member
Thu 06 Jul 2017 01:10:22 PM UTC, comment #4: 

Gor mxe-octave, added a patch for qscintilla: http://hg.octave.org/mxe-octave/rev/ca55304a3cfd


John Donoghue <lostbard>
Group Member
Wed 28 Jun 2017 04:05:28 PM UTC, comment #3: 

Posted upstream with scintilla fix: https://sourceforge.net/p/scintilla/bugs/1951/

John Donoghue <lostbard>
Group Member
Wed 28 Jun 2017 03:34:08 PM UTC, comment #2: 

Confirmed - its really an issue with Scintilla, but octave for windows is using updated code compared to what is used for standard qscintilla on Linux.

John Donoghue <lostbard>
Group Member
Tue 27 Jun 2017 04:21:39 PM UTC, comment #1: 

I found that 'while' is not matched to end statements, for code folding either. That by itself is not a problem (though I think it should), but that means the end for a while then becomes a mismatch for other folding statements so that any statements after it aren't properly marked for folding. E.g. :


a=0;
while a<3;
  a++;
endwhile

if true
  b=a;
endif
-varbatim-

The endwhile above isn't matched to the while (no folding for the while), so the if/endif aren't shown to match (but still fold).

Marshall <marsian>
Mon 26 Jun 2017 11:09:25 PM UTC, original submission:  

The 'end' keyword breaks proper code folding when used as an index to an array:


a = 1:5;
if true
    a(1:2)+=3;
    a(3:end)-=3; %code fold matched with if
    b = a;
    for i=1:3
        b+=1;
        if false
            b=3;
            b = a(end); %code fold matched with if
            q = b;
        endif
        a = 1;
    endfor
    c+3;
endif
a = 1:5;
if true
    a(1:2)+=3;
endif


Each 'end' used as an index will be matched improperly with the prior control statement, and won't be collapsed completely. Surrounding and following lines are shown to match to the wrong end statements, or for the last 'if' doesn't show any match lines, but still folds.

Marshall <marsian>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by marsian (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-07-15 lostbard StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2017-07-06 lostbard Item GroupNone Incorrect Result
        StatusConfirmed Ready For Test
    2017-06-28 lostbard StatusNone Confirmed
        Assigned toNone lostbard

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code