SynEdit Highlighter: what changed
Revision 3 to 4. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 1 | + | For more info on SynEdit go to: [[SynEdit]] | |
| 2 | 2 | Also see [[SynEdit Markup]] | |
| 3 | 3 | ||
| 4 | - | ||
| 4 | + | * * * | |
| 5 | 5 | ||
| 6 | 6 | # Understanding the SynEdit Highlighter | |
| 7 | 7 | ||
| 8 | 8 | ## SynEdit - Highlighter relationship | |
| 9 | 9 | ||
| 10 | - | ||
| 10 | + | **SynEdit to Highlighter** have an **N to 1** relationship. | |
| 11 | 11 | ||
| 12 | - | ||
| 13 | - | ||
| 14 | - | ||
| 12 | + | * One instance of a Highlighter can serve **N** (many) instances of SynEdits | |
| 13 | + | * Each SynEdit only has one Highlighter | |
| 14 | + | * But: one text (text-buffer) can have many highlighters, if shared by several SynEdit (each SynEdit will have one HL, but all HL will work on the same document) | |
| 15 | 15 | ||
| 16 | - | ||
| 16 | + | As a result of this: | |
| 17 | 17 | ||
| 18 | - | ||
| 18 | + | * no Highlighter Instance has a (fixed) reference to the SynEdit. | |
| 19 | 19 | ||
| 20 | - | ||
| 21 | 20 | (Highlighters however keep a list of SynEditTextBuffers to which they are attached) | |
| 22 | 21 | ||
| 23 | - | ||
| 22 | + | * All data for the Highlighter is (and must be) stored on the SynEdit (actually on the TextBuffer of SynEdit (referred to as "Lines"). | |
| 24 | 23 | ||
| 25 | - | ||
| 24 | + | However, before each call to the Highlighter, SynEdit ensures that Highlighter.CurrentLines is set to the current SynEdits Lines. This way the highlighter can access the data whenever needed. The Format of the data storage is determined by the highlighter (TSynCustomHighlighter.AttachToLines). | |
| 26 | 25 | ||
| 27 | 26 | ## Scanning and Returning Highlight attributes | |
| 28 | 27 | ||
| 29 | - | ||
| 28 | + | The Highlighter is expected to work on a per Line base. | |
| 30 | 29 | ||
| 31 | - | ||
| 30 | + | If any text was modified, SynEdit will call (TSynCustomHighlighter.ScanFrom / Currently called from TSynEdit.ScanFrom) with the line range. The Highlighter should know the state of the previous line. | |
| 32 | 31 | ||
| 33 | - | ||
| 32 | + | If Highlight attributes are required, SynEdit will request them per Line too. SynEdit will loop through individual tokens on a line. This currently happens from nested proc PaintLines in SynEdit.PaintTextLines. It calls TSynCustomHighlighter.StartAtLineIndex, followed by HL.GetTokenEx/HL.GetTokenAttribute for as long as HL.GetEol is false. | |
| 34 | 33 | ||
| 35 | - | ||
| 34 | + | Also the BaseClass for the Highlighter's data (see AttachToLines) is based on per line storage, and SynEdit's TextBuffer (Lines) do maintenance on this data to keep it synchronized. That is: whenever lines of text are inserted or removed, so are entries inserted or removed from the highlighters data (hence it must have one entry per line). | |
| 36 | 35 | ||
| 37 | - | ||
| 36 | + | Usually Highlighters store the end-of-line-status in this field. So if the highlighter is going to work on a line, it will continue with the state-entry from the previous line. | |
| 38 | 37 | ||
| 39 | 38 | ## Folding | |
| 40 | 39 | ||
| 41 | - | ||
| 42 | - | ||
| 43 | - | ||
| 40 | + | SynEdit's folding is handled by unit SynEditFoldedView and SynGutterCodeFolding. Highlighters that implement folding are to be based on TSynCustomFoldHighlighter. | |
| 44 | 41 | ||
| 45 | - | ||
| 46 | - | ||
| 42 | + | The basic information for communication between SynEditFoldedView and the HL requires 2 values stored for each line. (Of course the highlighter itself can store more information): | |
| 47 | 43 | ||
| 48 | - | ||
| 44 | + | * FoldLevel at the end of line | |
| 45 | + | * Minimum FoldLevel encountered anywhere on the line | |
| 49 | 46 | ||
| 50 | - | ||
| 51 | - | ||
| 52 | - | ||
| 53 | - | ||
| 54 | - | ||
| 55 | - | ||
| 56 | - | ||
| 57 | - | ||
| 58 | - | ||
| 59 | - | ||
| 60 | - | ||
| 47 | + | The Foldlevel indicates how many (nested) folds exist. It goes up whenever a fold begins, and down when a fold ends: | |
| 61 | 48 | ``` | |
| 62 | - | ||
| 63 | - | ||
| 64 | - | ||
| 65 | - | ||
| 66 | - | ||
| 49 | + | EndLvl MinLvl | |
| 50 | + | Procedure a; 1 - 0 | |
| 51 | + | Begin 2 -- 1 - | |
| 52 | + | b:= 1; 2 -- 2 -- | |
| 53 | + | if c > b then begin 3 --- 2 -- | |
| 54 | + | c:=b; 3 --- 3 --- | |
| 55 | + | end else begin 3 --- 2 -- | |
| 56 | + | b:=c; 3 --- 3 --- | |
| 57 | + | end; 2 -- 2 -- | |
| 58 | + | end; 0 0 // The end closes both: begin and procedure fold | |
| 67 | 59 | ``` | |
| 68 | 60 | ||
| 69 | - | ||
| 61 | + | In the line | |
| 62 | + | ``` | |
| 63 | + | Procedure a; 1 - 0 | |
| 64 | + | ``` | |
| 70 | 65 | ||
| 71 | - | ||
| 66 | + | the MinLvl is 0, because the line started with a Level of 0 (and it never went down / no folds closed). Similar in all lines where there is only an opening fold keyword ("begin"). | |
| 72 | 67 | ||
| 73 | - | ||
| 74 | - | ||
| 68 | + | But the line | |
| 75 | 69 | ``` | |
| 76 | - | ||
| 77 | - | ||
| 70 | + | end else begin 3 --- 2 -- | |
| 71 | + | ``` | |
| 78 | 72 | ||
| 79 | - | ||
| 73 | + | starts with a level of 3, and also ends with it (one close, one open). But since it went down first, the minimum level encountered anywhere on the line is 2. | |
| 80 | 74 | ||
| 81 | - | ||
| 75 | + | Without the MinLvl it would not be possible to tell that a fold ends in this line. | |
| 82 | 76 | ||
| 83 | - | ||
| 84 | - | ||
| 77 | + | There is no such thing as a MaxLvl, because folds that start and end on the same line can not be folded anyway. No need to detect them. | |
| 85 | 78 | ``` | |
| 86 | - | ||
| 87 | - | ||
| 88 | - | ||
| 89 | - | ||
| 79 | + | if a then begin b:=1; c:=2; end; // no fold on that line | |
| 80 | + | ``` | |
| 90 | 81 | ||
| 91 | - | ||
| 82 | + | ||
| 92 | 83 | ||
| 93 | - | ||
| 84 | + | # Creating a SynEdit Highlighter | |
| 94 | 85 | ||
| 95 | - | ||
| 86 | + | Since 0.9.31 Revision 35115 the fold-highlighter has changed. Implementing basic folding is now easier. | |
| 96 | 87 | ||
| 97 | - | ||
| 88 | + | All Sources can be found in the Lazarus installation directory under: | |
| 98 | 89 | ||
| 99 | - | ||
| 90 | + | * Lazarus 2.3 and up: examples\Components\SynEdit\NewHighlighterTutorial | |
| 91 | + | * Lazarus before 2.2.*: examples\SynEdit\NewHighlighterTutorial\ | |
| 100 | 92 | ||
| 101 | - | ||
| 93 | + | ||
| 94 | + | The project HighlighterTutorial contains 3 difference example highlighters: | |
| 102 | 95 | ||
| 103 | - | ||
| 96 | + | * SimpleHl: used in Step 1 below | |
| 97 | + | * ContextHl: used in Step 2 below | |
| 98 | + | * FoldHl: used in Step 3 below | |
| 104 | 99 | ||
| 105 | - | ||
| 100 | + | SimpleHl and ContextHl will work with 0.9.30 too | |
| 106 | 101 | ||
| 107 | - | ||
| 102 | + | The folding highlighter in action: | |
| 108 | 103 | ||
| 109 | - | ||
| 104 | + | [](</File:SynEditFoldingHighlighterDemo.png>) | |
| 110 | 105 | ||
| 111 | 106 | ## The Basics: Returning Tokens and Attributes | |
| 112 | 107 | ||
| 113 | - | ||
| 108 | + | As indicated, the **SimpleHl** unit demonstrates this process. | |
| 114 | 109 | ||
| 115 | 110 | ### What it does | |
| 116 | 111 | ||
| 117 | - | ||
| 118 | - | ||
| 119 | - | ||
| 112 | + | * It splits each line into words and spaces (or tabs) | |
| 113 | + | * The spaces are part of the text, and must be highlighted too | |
| 114 | + | * This example allows specifying different colors for | |
| 120 | 115 | ||
| 121 | - | ||
| 122 | - | ||
| 123 | 116 | \- text (defaults to not-highlighted) | |
| 124 | 117 | ||
| 125 | 118 | \- spaces (defaults to silver frame) | |
| 126 | 119 | ||
| 127 | 120 | \- words, separated by spaces, that start with a,e,i,o,u (defaults to bold) | |
| 128 | 121 | ||
| 129 | 122 | \- the word "not" (defaults to red background) | |
| 130 | 123 | ||
| 131 | 124 | ### How it works | |
| 132 | 125 | ||
| 133 | - | ||
| 126 | + | * Creation | |
| 134 | 127 | ||
| 135 | - | ||
| 128 | + | The Highlighter creates Attributes that it can return the Words and Spaces. | |
| 136 | 129 | ||
| 137 | - | ||
| 130 | + | * SetLine | |
| 138 | 131 | ||
| 139 | - | ||
| 132 | + | Is called by SynEdit before a line gets painted (or before highlight info is needed) | |
| 140 | 133 | ||
| 141 | - | ||
| 134 | + | * GetTokenEx, GetTokenAttribute, Next, GetEol | |
| 142 | 135 | ||
| 143 | - | ||
| 136 | + | Are used by SynEdit to iterate over the Line. Note that the first Token (Word or Spaces) must be ready after SetLine, without a call to Next. | |
| 144 | 137 | ||
| 145 | - | ||
| 138 | + | [[Important:]] The tokens returned for each line must represent the original line-text, and be returned in the correct order. | |
| 146 | 139 | ||
| 147 | - | ||
| 140 | + | * GetToken, GetTokenPos, GetTokenKind | |
| 148 | 141 | ||
| 149 | - | ||
| 142 | + | SynEdit uses them e.g for finding matching brackets. If tokenKind returns different values per Attribute, then brackets only match, if they are of the same kind (e.g. if there was a string attribute, brackets outside a string would not match brackets inside a string). | |
| 150 | 143 | ||
| 151 | 144 | ### Other notes | |
| 152 | 145 | ||
| 153 | - | ||
| 146 | + | For readability, the highlighter has no optimization, so it may be very slow on larger texts. Many of the supplied highlighters use hash functions, to find what word (or any group of chars) is. | |
| 154 | 147 | ||
| 155 | 148 | ## Step 2: Using Ranges | |
| 156 | 149 | ||
| 157 | - | ||
| 158 | - | ||
| 159 | - | ||
| 150 | + | As indicated, the **ContextHl** unit demonstrates this process | |
| 160 | 151 | ||
| 161 | - | ||
| 152 | + | The next example allows content of a line that influences other lines that follow. An example: a "(*" in Pascal makes all following lines a comment until a "*)" is found. | |
| 162 | 153 | ||
| 163 | - | ||
| 154 | + | This example extends the **SimpleHl** show above: The tokens -- and ++ (must be surrounded by space or line-begin/end to be a token of their own) will toggle words that start with a,e,i,o,u | |
| 164 | 155 | ||
| 165 | - | ||
| 156 | + | Multiple ++ and -- can be nested. Then for each -- a ++ must be given, before the words highlight again. | |
| 166 | 157 | ||
| 167 | - | ||
| 158 | + | Then we extend the scanner. The pre-scan to store the information calls the same functions as the highlighter. It is automatically called, if anything changes. (It is called for all lines below the changed line, until a line returns the same Range-value as it already had) | |
| 168 | 159 | ||
| 169 | - | ||
| 170 | - | ||
| 160 | + | The current amount of "--" is counted in | |
| 171 | 161 | ``` | |
| 162 | + | FCurRange: Integer; | |
| 163 | + | ``` | |
| 172 | 164 | ||
| 173 | - | ||
| 165 | + | The amount is decreased by "++" | |
| 174 | 166 | ||
| 175 | - | ||
| 167 | + | To store the info we use: | |
| 176 | 168 | ||
| 177 | - | ||
| 169 | + | **GetRange** | |
| 170 | + | ||
| 178 | 171 | Called after a line is completely scanned, to get the value at the end of the line. The value will be stored. | |
| 179 | 172 | ||
| 180 | - | ||
| 173 | + | **SetRange** | |
| 174 | + | ||
| 181 | 175 | Called before a line gets scanned. Sets the value stored from the end of the previous line. | |
| 182 | 176 | ||
| 183 | - | ||
| 177 | + | **ResetRange** | |
| 178 | + | ||
| 184 | 179 | Called before the 1st line is scanned (as there is no previous line). | |
| 185 | 180 | ||
| 186 | - | ||
| 181 | + |  **Note:** A scan is triggered by *every* change to a line (every keystroke). It scans the current line, and all lines below, until a line returns the same range that it already had. See: <http://forum.lazarus.freepascal.org/index.php/topic,21727.msg139420.html#msg139420> | |
| 187 | 182 | ||
| 188 | 183 | ### Important note on Ranges | |
| 189 | 184 | ||
| 190 | - | ||
| 191 | - | ||
| 192 | - | ||
| 185 | + | The purpose of the range is to allow the HL to start scanning in any line. The HL will not never need to look at a previous line. Any information needed to scan the current line can be derived from the ranges value. | |
| 193 | 186 | ||
| 194 | - | ||
| 195 | - | ||
| 196 | - | ||
| 197 | - | ||
| 187 | + | Example: | |
| 198 | 188 | ``` | |
| 189 | + | writeln; (* | |
| 190 | + | readln; | |
| 191 | + | *) | |
| 192 | + | ``` | |
| 199 | 193 | ||
| 200 | - | ||
| 194 | + | when scanning the "readln" the HL knows from the range that it is in a comment, it does not need to look back at previous lines. | |
| 201 | 195 | ||
| 202 | - | ||
| 196 | + | Therefore scanning can start at any line. | |
| 203 | 197 | ||
| 204 | - | ||
| 198 | + | This also explains the note in the previous chapter. "until a line returns the same range that it already had". For even if the text of a line was not changed, if the value of the range at the lines start changed, then the scan result will change too. | |
| 205 | 199 | ||
| 206 | - | ||
| 200 | + | ### Objects as Ranges - Incompatible change in 4.99 | |
| 207 | 201 | ||
| 208 | - | ||
| 202 | + | Using an object as range is possible. Currently this is done by having objects with a lifetime until all Highlighters are destroyed (refcounting may be added later). | |
| 209 | 203 | ||
| 210 | - | ||
| 204 | + | The pointer to any such object can be stored as range. However, pointers stored in the range can get lost. Therefore all objects must be hold in an additional container. This additional container also allows to detect existing objects with equal values to a new object, and allows de-duplication. | |
| 211 | 205 | ||
| 212 | - | ||
| 206 | + | ||
| 213 | 207 | ||
| 214 | - | ||
| 215 | - | ||
| 216 | - | ||
| 217 | - | ||
| 218 | - | ||
| 208 | + | #### Up to an including 4.x | |
| 219 | 209 | ||
| 220 | - | ||
| 210 | + | The objects where stored in an avl tree. Objects needed to provide a "Compare" method returning an integer: negative, zero or positive. To allow ordering. | |
| 221 | 211 | ||
| 222 | - | ||
| 223 | - | ||
| 224 | - | ||
| 225 | - | ||
| 226 | - | ||
| 227 | - | ||
| 212 | + | #### 4.99 and up | |
| 228 | 213 | ||
| 229 | - | ||
| 230 | - | ||
| 231 | - | ||
| 232 | - | ||
| 233 | - | ||
| 214 | + | See **unit LazEditHighlighterUtils** | |
| 234 | 215 | ||
| 235 | - | ||
| 236 | - | ||
| 237 | - | ||
| 238 | - | ||
| 239 | - | ||
| 216 | + | The objects are stored in a TDictionary. | |
| 217 | + | ||
| 218 | + | * Compare most return zero (equal) or none-zero (different) | |
| 219 | + | * A method **GetHashCode** must return a hash value, for the dictionary | |
| 220 | + | ||
| 221 | + | ## Step 3: Add Folding | |
| 222 | + | ||
| 223 | + | As indicated, the **FoldHl** unit demonstrates this process | |
| 224 | + | ||
| 225 | + | For the example, the highlighter should fold everything between free-standing "-(-", "-)-". | |
| 226 | + | ||
| 227 | + | Change inheritance: | |
| 240 | 228 | ``` | |
| 229 | + | uses SynEditHighlighterFoldBase; | |
| 230 | + | ... | |
| 231 | + | TSynDemoHl = class(TSynCustomFoldHighlighter) | |
| 232 | + | ``` | |
| 241 | 233 | ||
| 242 | - | ||
| 234 | + | Change the way range info is stored, since the base class uses it for fold-info: | |
| 235 | + | ``` | |
| 236 | + | procedure TSynDemoHl.SetRange(Value: Pointer); | |
| 237 | + | begin | |
| 238 | + | inherited; | |
| 239 | + | FCurRange := PtrInt(CodeFoldRange.RangeType); | |
| 240 | + | end; | |
| 241 | + | ||
| 242 | + | procedure TSynDemoHl.ResetRange; | |
| 243 | + | begin | |
| 244 | + | inherited; | |
| 245 | + | FCurRange := 0; | |
| 246 | + | end; | |
| 247 | + | ||
| 248 | + | function TSynDemoHl.GetRange: Pointer; | |
| 249 | + | begin | |
| 250 | + | CodeFoldRange.RangeType := Pointer(PtrInt(FCurRange)); | |
| 251 | + | inherited; | |
| 252 | + | end; | |
| 253 | + | ``` | |
| 243 | 254 | ||
| 244 | - | ||
| 255 | + | Now add code to the scanner which tells the highlighter about opening and closing folds: | |
| 256 | + | ``` | |
| 245 | 257 | procedure TSynDemoHl.FindTokenEnd; | |
| 246 | - | ||
| 247 | - | ||
| 248 | - | ||
| 249 | - | ||
| 250 | - | ||
| 251 | - | ||
| 252 | - | ||
| 253 | - | ||
| 258 | + | begin | |
| 259 | + | ... | |
| 260 | + | ||
| 261 | + | if (FTokenEnd = FTokenPos+1) and (FLineText[FTokenPos] = '[') then | |
| 262 | + | StartCodeFoldBlock(nil); | |
| 263 | + | if (FTokenEnd = FTokenPos+1) and (FLineText[FTokenPos] = ']') then | |
| 264 | + | EndCodeFoldBlock(); | |
| 265 | + | end; | |
| 254 | 266 | ``` | |
| 255 | 267 | ||
| 256 | - | ||
| 268 | + | * **For 0.9.30** | |
| 257 | 269 | ||
| 258 | - | ||
| 270 | + | Please see the history of this page, if you are using a 0.9.30 version [[[1]](<http://wiki.lazarus.freepascal.org/index.php?title=SynEdit_Highlighter&oldid=76020>)] | |
| 259 | 271 | ||
| 260 | 272 | #### More info on StartCodeFoldBlock / EndCodeFoldBlock | |
| 261 | - | ||
| 262 | - | ||
| 263 | - | ||
| 264 | 273 | ``` | |
| 274 | + | function StartCodeFoldBlock(ABlockType: Pointer; IncreaseLevel: Boolean = true): TSynCustomCodeFoldBlock; virtual; | |
| 275 | + | ``` | |
| 265 | 276 | ||
| 266 | - | ||
| 267 | - | ||
| 277 | + | **ABlockType** | |
| 268 | 278 | ||
| 269 | - | ||
| 270 | - | ||
| 271 | - | ||
| 279 | + | Can be used to specify an ID for the block. | |
| 272 | 280 | ||
| 273 | - | ||
| 274 | - | ||
| 275 | - | ||
| 281 | + | The field is not normally used as a pointer (though this is permitted). Normally IDs are a numeric enumeration. | |
| 282 | + | If you have different types of block (e.g. in Pascal: begin/end; repeat/until, ...), and you do not want a block being closed by the wrong keyword ("end" should not close "repeat"), then you can give them IDs: | |
| 283 | + | **StartCodeFoldBlock(PtrUInt(1))** // or other numbers | |
| 276 | 284 | ||
| 277 | - | ||
| 278 | - | ||
| 279 | - | ||
| 285 | + | **IncreaseLevel** | |
| 280 | 286 | ||
| 281 | - | ||
| 282 | - | ||
| 287 | + | If set to False, then a block will be inserted that can not be folded. | |
| 288 | + | Blocks like that can be used for internal tracking. | |
| 289 | + | ||
| 290 | + | NOTE: All folds must be nested, they can not overlap. That is, the last opened fold must be closed first. | |
| 291 | + | This refers to the "EndLvl" as shown in "Folding"(1.3) above | |
| 292 | + | Overlaps (like IFDEF and begin in the IDE) can not be done this way. | |
| 283 | 293 | ``` | |
| 294 | + | procedure EndCodeFoldBlock(DecreaseLevel: Boolean = True); virtual; | |
| 295 | + | ``` | |
| 284 | 296 | ||
| 285 | - | ||
| 286 | - | ||
| 297 | + | **DecreaseLevel** | |
| 287 | 298 | ||
| 288 | - | ||
| 289 | - | ||
| 299 | + | This *must* match IncreaseLevel, as it was given on the StartCodeFoldBlock | |
| 290 | 300 | ||
| 291 | - | ||
| 292 | - | ||
| 301 | + | True means a fold ends; False means an internal block is ended. If mismatched then folds will either continue, or end early. | |
| 302 | + | TopCodeFoldBlockType can be used to indicate the ID of the innermost open block. One can use different IDs for internal blocks, and use this to set the value. | |
| 293 | 303 | ``` | |
| 304 | + | function TopCodeFoldBlockType(DownIndex: Integer = 0): Pointer; | |
| 305 | + | ``` | |
| 294 | 306 | ||
| 295 | - | ||
| 307 | + | Returns the ID of the innermost block. | |
| 296 | 308 | ||
| 297 | - | ||
| 309 | + | **DownIndex** | |
| 310 | + | ||
| 298 | 311 | can be used to get ID for the other block. | |
| 299 | 312 | ||
| 300 | - | ||
| 313 | + | DownIndex=1 means the block that is surrounding the innermost. | |
| 301 | 314 | ||
| 302 | 315 | # Configurable Highlighters (incl. 3rd party) | |
| 303 | 316 | ||
| 304 | 317 | ## SynAnySyn | |
| 305 | 318 | ||
| 306 | - | ||
| 319 | + | A real simple Highlighter. More a reference implementation, than a real life useable Highlighter. | |
| 307 | 320 | ||
| 308 | 321 | ## SynUniHighlighter | |
| 309 | 322 | ||
| 310 | - | ||
| 323 | + | Uses XML-based configurations files. [old official link](<http://web.archive.org/web/20090610040212/http://www.delphist.com:80/UniHighlighter.html>) | |
| 311 | 324 | ||
| 312 | 325 | ## SynFacilSyn | |
| 313 | 326 | ||
| 314 | 327 | Flexible fully configurable Highlighter. <https://github.com/t-edson/SynFacilSyn> | |
| 315 | 328 | ||
| 316 | 329 | # References | |
| 317 | 330 | ||
| 318 | - | ||
| 331 | + | Threads on the forum: | |
| 319 | 332 | ||
| 320 | - | ||
| 321 | - | ||
| 322 | - | ||
| 323 | - | ||
| 324 | - | ||
| 325 | - | ||
| 326 | - | ||
| 327 | - | ||
| 333 | + | * "Making highligher for C syntaxis" [[topic,10260](<http://www.lazarus.freepascal.org/index.php/topic,10260.0.html>)] | |
| 334 | + | * "Creating a Syntax Highlighter" [[topic,10959.msg54714](<http://www.lazarus.freepascal.org/index.php/topic,10959.msg54714>)] | |
| 335 | + | * obtaining highlight for printing [[11384.msg57160](<http://www.lazarus.freepascal.org/index.php/topic,11384.msg57160.html#msg57160>)] | |
| 336 | + | * Some details on ranges, and using objects to store more info [[topic,21727.msg139354](<http://forum.lazarus.freepascal.org/index.php/topic,21727.msg139354.html#msg139354>)] and [[topic,21727.msg139419](<http://forum.lazarus.freepascal.org/index.php/topic,21727.msg139419.html#msg139419>)] | |
| 337 | + | * More on ranges, working copy vs immutable, foldblocks... [[http://forum.lazarus.freepascal.org/index.php/topic,30685](<http://forum.lazarus.freepascal.org/index.php/topic,30685.msg195464.html#msg195464>)] | |
| 338 | + | * Markup (Highlight) all occurrences of a token (or regex) [[topic=26833](<http://forum.lazarus.freepascal.org/index.php?topic=26833>)] | |
| 339 | + | * Markup and foldinfo: [[[2]](<http://forum.lazarus.freepascal.org/index.php?topic=30122>)] | |
| 340 | + | * How to do invalidation in TSynEditMarkup [[[3]](<http://forum.lazarus.freepascal.org/index.php/topic,30122.msg207931.html#msg207931>)] | |
| 328 | 341 | ||
| 329 | - | ||
| 330 | - | ||
| 331 | - | ||
| 332 | - | ||
| 333 | - | ||
| 334 | - | ||
| 335 | - | ||
| 342 | + | * Folding | |
| 343 | + | * "SynEdit - improved highlighters to handle Code Folding?" [[topic,7879](<http://www.lazarus.freepascal.org/index.php/topic,7879.0.html>)] | |
| 344 | + | * "SynEdit - Add support code folding for Java" [[topic,7338](<http://www.lazarus.freepascal.org/index.php/topic,7338.0.html>)] | |
| 345 | + | * "CodeFolding" Config [[topic,11064](<http://www.lazarus.freepascal.org/index.php/topic,11064>)] | |
| 346 | + | * Fold blocks "end" keyword (end on the line before the next keyword) [[topic,23411.msg139621](<http://forum.lazarus.freepascal.org/index.php/topic,23411.msg139621.html#msg139621>)] | |
| 347 | + | * Folding selected text from code (user/application code): [[24473.msg147312](<http://forum.lazarus.freepascal.org/index.php/topic,24473.msg147312.html#msg147312>)] | |
| 348 | + | * Obtaining state of folding (save fold state with session) [[topic=26748](<http://forum.lazarus.freepascal.org/index.php?topic=26748>)] | |
| 336 | 349 | ||
| 337 | 350 | --- | |
| 338 | - | ||
| 339 | - | ||
| 351 | + | *From the Free Pascal wiki, page "SynEdit Highlighter", as the Internet Archive kept it on 2025-04-18, last changed on 2025-04-03. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
