Tapatalk

Code folding bugs

Code folding bugs

3
NewbieNewbie
3

    Sep 24, 2010#1

    Hi.
    I'm running the Ultraedit demo (16.20.0.1009) here and have some problems with code folding. When pressing Ctrl+subtract it sometimes only fold a couple of lines which actually just disappears without any plus/minus sign. One time it removed the toplines including the + sign so I couldn't unfold it again. It seem to be very unstable.

    Great editor by the way, I'm buying it today ! :)

    6,685587
    Grand MasterGrand Master
    6,685587

      Sep 24, 2010#2

      I have never seen a problem as you described in that version of UltraEdit or any other version. Could you upload your file packed with ZIP or RAR as attachment and post also the 2 lines of the wordfile used for highlighting this file with the definition of the code folding strings?

      Of course if the file contains private data, you better send IDM by email your file, the used wordfile, some screenshots saved as PNG files and a description of the wrong behavior.
      Best regards from an UC/UE/UES for Windows user from Austria

      3
      NewbieNewbie
      3

        Oct 08, 2010#3

        Its not a specific wordfile. I use the C wordfile that came with the demo.
        If I for instance create a test.c file and make a struct:

        Code: Select all

        1: typedef struct mystruct_s {
        2:   int myInt;
        3:   char myChar;
        4:   short myShort;
        5: } mystruct_t;
        and I have my cursor on line 3 and press the code folding shortcut it removes that line only. Using the mouse on the plus sign works fine though.
        If I press the plus sign then after that the keyboard shortcut will work in that struct, but not in another.
        The same thing happen if I try for any of the other wordfiles that comes with the Ultraedit demo.

        6,685587
        Grand MasterGrand Master
        6,685587

          Oct 08, 2010#4

          I think this is not a bug, that is the designed behavior.

          The code folding feature identifies blocks with the code folding strings as defined in the wordfile and offers the user to simply click on the [-] symbol to fold such a block without manually selecting the lines of a block to fold.

          But the feature to hide lines of no interest at the moment is not only used by the code folding feature.

          You can at any time select multiple lines (a block) and execute command View - Hide/Show Lines - Hide/Show Selection by clicking on menu item command or executing the command by hotkey to hide the selected lines. And it is also possible to simply hide the current line without selecting it. Those features are mainly used for log files and not for source code files of a programming language.

          So when nothing is selected and command Hide/Show Selection is executed, UltraEdit does following:
          1. The current line is above 1 or more hidden lines - symbol [+] visible - the hidden lines are displayed again.
          2. The current line is a line identified by the code folding engine as first line of a block which could be interesting for folding - symbol [-] visible on that line. The block is folded now by UltraEdit by hiding the lines below the first line of the block.
          3. The current line is nothing special, UltraEdit hides the current line.
          Best regards from an UC/UE/UES for Windows user from Austria

          3
          NewbieNewbie
          3

            Oct 08, 2010#5

            If it's a designed behavior I have to admit I don't approve of it. It's really confusing.
            Go to one line, press view/hide line shortcut, go to another line and press the same. How do you get your lines back? Only option is to expand all. Not to speak of all the dangling plus-signs in the margin that doesn't do anything, nothing happen when you click on them.
            Another thing. If you make 2 structs, press the + on one of them, the view/hide line will fold that whole struct the next time you press it inside it. So where has the one line hide feature gone ? And if you then go into the 2nd struct and press view/hide the first struct folds.

            I hope I don't sound harsh here, its just a very unexpected behavior of a feature I heavily rely on. I'm a Mac user that are looking around for a good windows text editor. I really like UE besides from a very few quirks (code completion, folding & camelcase word navigation). Other parts of it are just brilliant !

            6,685587
            Grand MasterGrand Master
            6,685587

              Oct 08, 2010#6

              Geir wrote:Go to one line, press view/hide line shortcut, go to another line and press the same. How do you get your lines back?
              Well, I'm just a user like you and therefore I wrote "I think this is not a bug" and not that I know it definitely. Only an IDM developer can rate the current behavior as I explained as designed behavior or as bug. I'm also a programmer and I agree with you that it would make more sense for a syntax highlighted file with code folding that executing command Hide/Show Selection on a line anywhere inside an identified block for being foldable should result in moving the caret to start of the first line of the block and fold respectively hide the rest of the block if there is currently no selection.

              However, when a single line is hidden the line above gets the plus sign to unhide the single hidden line. As I wrote hiding single lines is more useful for looking on logs and the lines are hidden by executed a Find with pressing button Hide Lines or Show Lines.
              Geir wrote:If you make 2 structs, press the + on one of them, the view/hide line will fold that whole struct the next time you press it inside it. So where has the one line hide feature gone?
              You are right and this behavior is most likely not designed. When folding one block, unfold it, move caret down or up to any other block or a line outside any block and executing the command Hide/Show Selection with nothing selected and the current line has no plus or minus sign, not the current line is hidden or the current block folded, instead the last unfold is undone independent of the position of the cursor. That is indeed very strange. Moving the caret down/up to another line with no plus or minus sign and executing the command again hides only this line. Strange, really strange.

              I will report this issue by email to IDM support and also ask if the behavior with single line hide is really by design or a bug.
              Geir wrote:I really like UE besides from a very few quirks (code completion, folding & camelcase word navigation).
              I don't know what you understand by "code completion", but UltraEdit as general text editor does not really have a code completion feature. IntelliSense is supported only by UEStudio, of course not for all languages and only when the project is setup in a way to make it possible to build a symbol database.

              You have a problem with CamelCase word navigation? Do you have the configuration setting CamelCase naming stops for Ctrl left/right arrow checked or unchecked at Advanced - Configuration - Editor Display - Cursor/Caret?
              Best regards from an UC/UE/UES for Windows user from Austria