1

I'm attempting to create a user defined language based on code for motion capture syntax files (in Visual3D). I want to fold code based on the following syntax

The open argument always looks like this !***************************************************************
! Right Knee Flexion
!***************************************************************

and the close section is always ;. The issue is that the second line of the "Open" is never the same. Sometimes it may be ! Left Knee Flexion etc. But it will always begin with !. Does anyone have any idea on how I could enter this as a User Defined Language?

shilovk
  • 11,718
  • 17
  • 75
  • 74
Patrick
  • 915
  • 2
  • 9
  • 26

2 Answers2

0

This is the first time that I looked into this capability, but it appears to be possible.

Not sure how you created yours, but I put your snippet into Notepad++ (with an extra line after the one in the middle -- only to see if it would keep the fold 'range'), and then chose Language => Define your language... from the menu.

In the next User Defined Language dialog window, I set the options shown below in the red markers and the folding block appears:

enter image description here

I'm guessing that you could set the same for your info?

Paul T.
  • 4,703
  • 11
  • 25
  • 29
0

For those interested. I was able to get the desired output for Visual3D by modifying the "Operators1" field. Below is the "Language" file. I hope this comes in useful to someone.

<NotepadPlus>
    <UserLang name="Vis3D" ext="" udlVersion="2.1">
        <Settings>
            <Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="1" />
            <Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
        </Settings>
        <KeywordLists>
            <Keywords name="Comments">00!! 01 02 03 04</Keywords>
            <Keywords name="Numbers, prefix1"></Keywords>
            <Keywords name="Numbers, prefix2"></Keywords>
            <Keywords name="Numbers, extras1"></Keywords>
            <Keywords name="Numbers, extras2"></Keywords>
            <Keywords name="Numbers, suffix1"></Keywords>
            <Keywords name="Numbers, suffix2"></Keywords>
            <Keywords name="Numbers, range"></Keywords>
            <Keywords name="Operators1">/PIPELINE_PARAMETER_NAME /PROMPT /DATA_TYPE  /FILE_NAME /PARAMETER_NAME /SUFFIX /SET_PROMPT /USE_POSSIBLE_VALUES /Motion_File_Names /Query /Tags /POSSIBLE_VALUES /DEFAULT_VALUES  /PARAMETER_VALUE</Keywords>
            <Keywords name="Operators2"></Keywords>
            <Keywords name="Folders in code1, open">!**</Keywords>
            <Keywords name="Folders in code1, middle"></Keywords>
            <Keywords name="Folders in code1, close">!*</Keywords>
            <Keywords name="Folders in code2, open"></Keywords>
            <Keywords name="Folders in code2, middle"></Keywords>
            <Keywords name="Folders in code2, close"></Keywords>
            <Keywords name="Folders in comment, open"></Keywords>
            <Keywords name="Folders in comment, middle"></Keywords>
            <Keywords name="Folders in comment, close"></Keywords>
            <Keywords name="Keywords1">Assign_Tags_To_Files&#x000D;&#x000A;Set_Pipeline_Parameter_To_Folder_Path&#x000D;&#x000A;Prompt_For_Pipeline_Parameter_Value&#x000D;&#x000A;Open_File</Keywords>
            <Keywords name="Keywords2"></Keywords>
            <Keywords name="Keywords3"></Keywords>
            <Keywords name="Keywords4"></Keywords>
            <Keywords name="Keywords5"></Keywords>
            <Keywords name="Keywords6"></Keywords>
            <Keywords name="Keywords7"></Keywords>
            <Keywords name="Keywords8"></Keywords>
            <Keywords name="Delimiters">00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
        </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" fgColor="FFFFFF" bgColor="000000" fontStyle="0" nesting="0" />
            <WordsStyle name="COMMENTS" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="LINE COMMENTS" fgColor="FFFFFF" bgColor="000000" fontStyle="0" nesting="0" />
            <WordsStyle name="NUMBERS" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS1" fgColor="0080FF" bgColor="000000" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS2" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS3" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS4" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="OPERATORS" fgColor="00FF40" bgColor="000000" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN CODE1" fgColor="FFFFFF" bgColor="000000" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS1" fgColor="00FF00" bgColor="000000" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS2" fgColor="0080FF" bgColor="000000" fontStyle="0" nesting="2" />
            <WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
        </Styles>
    </UserLang>
</NotepadPlus>
Patrick
  • 915
  • 2
  • 9
  • 26