Menu

#120 folding causes incorrect display, occasionally lines of code vanish

Next_Release
open
Bug_Report
2016-01-30
2014-12-23
Riot
No

When using "fold all" on certain code (it seems to be related to braces in comments), the code sometimes fails to fold correctly:

The test code:

class Myclass {
  myfunction1() {
    //(){
    //}
  }
  // this part should be folded
  myfunction2() {
  }
};

Demo:

This looks quite minor here in this reduced test case, but in certain more complicated files it makes a complete mess, making the folding feature unusable entirely for those files.

Additionally, and perhaps more seriously when repeatedly modifying the comments and folding and unfolding the code, on occasion other lines of code vanish from the display. However, they are saved in the file, and if the tab is closed and reopened, or if the code is cut and pasted, they reappear. This happened twice with the "// this part should be folded" comment vanishing while I was playing with the commented braces above, but I have since not been able to reproduce the effect even by repeating the exact changes from my edit history; there's possibly an overflow somewhere causing this effect.

Discussion

  • Riot

    Riot - 2014-12-23

    That code didn't paste correctly; it should be:

    class Myclass {
      myfunction1() {
        //(){
        //}
      }
    
      // this should be folded
      myfunction2() {
      }
    };
    
     
  • Teodor Petrov

    Teodor Petrov - 2014-12-29

    Can you reproduce the same problem in scite?
    If you can please report this problem to the scintilla project and the give us the ticket number. If you cannot then we will have to see what is going on inside the cb's codebase.

     
    • Riot

      Riot - 2014-12-29

      Yes you're right, it does occur in Scite. Bug reported here: https://sourceforge.net/p/scintilla/bugs/1676/

       
    • Riot

      Riot - 2014-12-30

      They say it's uh, intended behaviour. https://sourceforge.net/p/scintilla/bugs/1676/

      I would suggest adding a menu option to toggle this behaviour in codeblocks.

      I still haven't been able to reproduce the disappearing line bug but it seems that may be unrelated in that case.

       
  • Teodor Petrov

    Teodor Petrov - 2014-12-30
    • labels: --> Editor, Folding
    • assigned_to: Teodor Petrov
     
  • Teodor Petrov

    Teodor Petrov - 2014-12-30

    Ok, I'll assign this bug to myself and I'll see if I can find some time in the future to fix it. Until then patches welcome. It should be trivial to add.

     
  • Morten MacFly

    Morten MacFly - 2015-02-07
    • Type: --> Undefined
     
  • Alpha

    Alpha - 2015-02-08
    • Type: Undefined --> Bug_Report
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.