Tapatalk

Any way to 'prefold' code folds?

Any way to 'prefold' code folds?

2

    Apr 09, 2006#1

    I'm working with a 'very large file' format (Poser) and have designed a Syntax Highlighting for the format. These files can be 100's MB and it would be nice to be able to prefold sections (esp. certain subsections) that can be folded.

    Does UE have anything like this? Since the file format is something like this:

    Code: Select all

    {
    	keywordA
    	{
    		keywordB
    		{
    		}
    	}
    }
    where the entire file is always encapulated by '{' and '}', "Collapse All" just collapses the entire file (how useful is that - not). What would be nice is either a level collapse or some sort of way to use keyword to determine what to collapse. If this could be done using Macros, then I'm all for it. :)

    Thanks,

    Robert

    6,685587
    Grand MasterGrand Master
    6,685587

      Apr 09, 2006#2

      If you activate the option Save bookmarks at Configuration - Editor - Bookmarks then UltraEdit will save the current code folding for every file in it's uedit32.ini. So you only have to fold your file once manually and next time you open it UltraEdit will automatically fold it again.

      You can also create a macro which selects a specific block and folds it. For your example the macro is:

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOff
      Top
      Find RegExp "% keywordB"
      StartSelect
      Find RegExp Select "% }"
      HideOrShowLines
      EndSelect
      Top
      Find RegExp "% keywordA"
      StartSelect
      Find RegExp Select "% }"
      HideOrShowLines
      EndSelect
      Top

      Add UnixReOn or PerlReOn (v12+ of UE) at the end of the macro if you do not use UltraEdit style regular expressions by default - see search configuration. Macro command UnixReOff sets the regular expression option to UltraEdit style.
      Best regards from an UC/UE/UES for Windows user from Austria

      2

        Apr 09, 2006#3

        Thanks, Mofi. I'll give it a try and see how far I can take it.

        Robert