Reset Code Folding

Reset Code Folding

7
NewbieNewbie
7

    Jul 15, 2015#1

    I use code folding heavily for my To Do lists through the use of EnableCFByIndent. It is a fabulous feature. However, there appears to be a bug.

    Quite often when manipulating text, especially with cut/paste I find that the code folding mechanism gets out of sync (loses it's mind) and associates lines which should not be connected (or vice versa).

    While it would be nice if this didn't happen, my interest with this post is learning whether there is any simple way to get UltraEdit to reevaluate my text file and reset the indenting. Typically, I just add and then delete some carriage returns, but that can get annoying. I have also found that selecting all text and then cut/paste will reset everything correctly, as will expanding and then collapsing all lines will work as well. But none of those are elegant and all of them have unwanted side effects.

    Any ideas out there?

    19476
    MasterMaster
    19476

      Jul 16, 2015#2

      Save and then Revert to Saved?

      6,681583
      Grand MasterGrand Master
      6,681583

        Jul 18, 2015#3

        JFord, I wanted to suggest same as fleggy, but first wanted to reproduce what you wrote: a code folding out of sync after cutting/pasting lines. But I failed to reproduce this. This is perhaps because I don't have any wordfile using code folding by indent. I recommend reporting this issue to IDM support by email with a step by step description, the used wordfile and a sample file in case of being able to find out the steps necessary for reproducing this issue.

        Save + Revert to Saved is useful only as workaround with having a hotkey assigned to command FileRevertToSaved in key mapping configuration dialog.

        Is code folding also updated when hotkey assigned to Search - Function List (default: F8, command is SearchFunctionList in key mapping configuration) is pressed which results in rescanning the file for strings to list in the function list and opening the function list in case of not being opened at the moment?

        I wanted to test this out by myself before suggesting it here, but as I can't get code folding out of sync, I could not verify if this command results also in updating code folding database.
        Best regards from an UC/UE/UES for Windows user from Austria

        7
        NewbieNewbie
        7

          Aug 15, 2015#4

          Thanks for the replies on this one. As usual, I mistakenly assumed that this would be a quick simple answer.

          In the weeks between I have determined several things:

          (1) I cannot consistently get it to fail with a simple repeatable sequence of keystrokes, but I can get it to fail often. Often it's either cutting and pasting in the middle of an outline or selecting text and indenting or outdenting it with {tab} and +{tab} or splitting the header line of a collapsed section into two lines. I will keep looking for something more concrete than that.

          (2) In many cases just plain saving the file will correct things. It's funny to press ^s and see the little outline markers on the whole page rearrange themselves. If save doesn't work then next I try "expand all" followed by "collapse all". In most cases one of those steps will correct things, but sometimes not, so I have to add then remove a blank line around the problem area. This almost always corrects things, but sometimes I plain can't ever get the program to realize that the lines are being mapped incorrectly.

          (3) I see two additional areas where there are more repeatable behaviors that I would classify as bugs:
          (3a) Create a file with "aaa" on the first line and "bbb" on the second line, no spaces, no tabs. Go to the first line. Select collapse. The second line will be sucked into the first. In my opinion on either line of that file expand or collapse are no-ops. This could be more complicated on a line in the middle of an outline. But if you add some additional indented lines (ccc, ddd, etc.) at different levels and then play with expand and collapse functions some very bizarre things will begin to happen.
          (3b) The collapse all function often will not actually collapse all if the cursor is in the middle of the outline.
          (3c) I have seen times where collapsing all will leave the cursor hanging in the middle of white space, but still in edit mode where you are making changes to characters that are not being displayed.

          I think it might be important to point out that I am always using the keyboard and not the mouse for every action in UltraEdit. I see and appreciate the little outline markers, but I am never clicking on them.

          6,681583
          Grand MasterGrand Master
          6,681583

            Aug 15, 2015#5

            That's all very interesting. I'm not using myself in any of my wordfiles EnableCFByIndent and therefore don't have any experience in code folding based on indentation level. So I can only suggest reporting the issues you see to IDM support by email if you can describe them with a step by step instruction list for reproducing the issue.
            Best regards from an UC/UE/UES for Windows user from Austria