User to user discussion and support for UltraEdit, UEStudio, UltraCompare, and other IDM applications.

Syntax highlighting, code folding, brace matching, code indenting, and function list
19 posts Page 2 of 2
That's an interesting issue which was never reported by before by a forum member.

First, I suggest to check if at Advanced - Settings/Configuration - Application Layout - Advanced the setting Store windows/menu/toolbars placements and configurations for multiple instances of application is currently enabled which is not the default as this would at least explain why getting a different display in second instance of UltraEdit. Uncheck this option except you want different displays depending on instance of UltraEdit.

Second, I suggest to open the folder %APPDATA%\IDMComp\UltraEdit in Windows Explorer (copy and paste this string into address bar and hit key RETURN to open the folder) while no instance of UltraEdit is running and delete all uedit32.in0, uedit32.in1, ... respectively uedit64.in0, uedit64.in1, ... which are the workspace files with the display settings. But do not delete the file uedit32.ini respectively uedit64.ini as this contains your configuration settings. Start UltraEdit and reconfigure the workspace (views, ribbons or toolbars, ...) as you like it.

Third, open the folder %APPDATA%\IDMComp\UltraEdit\wordfiles containing the syntax highlighting wordfiles. Open them all in UltraEdit and look on first line in all opened wordfiles if more than one *.uew file contains the file extension PY (case-insensitive) after File Extensions =. That would not be good. Just one file should contain the file extension PY, the one you prefer for syntax highlighting Python files. This wordfile should contain also the language marker keyword PYTHON_LANG in first line after double quoted language name. But it is okay if another wordfile contains also PYTHON_LANG.

Fourth, as it is written above the language marker keyword PYTHON_LANG enables code folding by indent level as required for Python syntax. A wordfile containing PYTHON_LANG must not have the keyword EnableCFByIndent, but it is definitely no mistake to explicitly add it for example after PYTHON_LANG. Important is that the wordfile with PYTHON_LANG and/or EnableCFByIndent does not have additionally the lines starting with /Open Fold Strings = and /Close Fold Strings =.

Fifth, check if in first running instance of UltraEdit a project/workspace is loaded which has a wordfiles directory or single wordfile configured in the project settings resulting in ignoring the wordfiles in %APPDATA%\IDMComp\UltraEdit\wordfiles.

Last a question:

Do you have a different wordfiles directory configured at Advanced - Settings/Configuration - Editor Display - Syntax Highlighting as I have on my computers?
Best regards from Austria
I still cannot get the Python code folding working, only partly.
I use the default Python wordfile that came with the lastest (24.10) Portable version of UEm. No other Python word files are present.

The IF's do not get recognised. Some do, most don't.
Sometimes the IF does not get recognized, the ELSE does.

I've tried all the steps in the post above.
File extension is .py.
I have also tried deleting all ini files. Also then code folding is not working as expected.
Btw: the code works, so it is not a coding issue.

Code: Select all
    # Ask for and open import file.
    print ("Asking for input file...")
    root = tkinter.Tk()
    root.withdraw()
    file_path = filedialog.askopenfilename(parent=root)
    if os.path.exists(file_path):
        filename = open(file_path)
    else:
        print(file_path)
        sys.exit("File does not exists: "+file_path)

    # Delete old files.
    if os.path.exists(CURRENT_PATH+"/"+FILENAME_UK):
        os.remove(CURRENT_PATH+"/"+FILENAME_UK)
    if os.path.exists(CURRENT_PATH+"/"+FILENAME_IE):
        os.remove(CURRENT_PATH+"/"+FILENAME_IE)
    if os.path.exists(CURRENT_PATH+"/"+ZIPFILENAME):
        os.remove(CURRENT_PATH+"/"+ZIPFILENAME)

Attachments

Wolfje63, the Python code folding works perfect for your example, but most likely not as expected by you because of the configured code folding settings. Open Advanced - Settings or Configuration - Editor Display - Code Folding and click on button Help for the descriptions of the code folding settings.

Show last line of fold in syntax highlighted files is enabled by default. So displayed is always the first and the last line of a folded block. That means a block must have at least 3 lines to hide at least one line. This is true for your example only for the else branch. All if blocks have only 2 lines.

Uncheck the setting Show last line of fold in syntax highlighted files and close the configuration dialog with button OK. The display changes shortly after closing the configuration. Now [-] is displayed additionally also on every if statement because at least 1 line could be folded on each if block.
Best regards from Austria
Thanks Mofi, that worked :D.
19 posts Page 2 of 2