[SynEdit] How to make markups move with editing the text? lazarus / 31-LCL ---------------------------------------------------------------------- Pascal · 2015-03-27 06:09 Hallo, is it possible to make the markups move with the editied text. For example when lines are inserted or text is entered inside a makup? Like the IDE does with error markups? I've created my own markups derived from TSynEditMarkupHighlightMatches. But they do not move with the text. Pascal ---------------------------------------------------------------------- Martin_fr · 2015-03-27 15:24 There is no code in the Markup tat does this for you. The Markup receives a call to: Code: [Select]procedure TSynEditMarkup.DoTextChanged(StartLine, EndLine, ACountDiff: Integer); This allows you to 1) Recreate the matches in the affected lines 2) Move up/down any matches after the lines affected. If you need a more exact notification what was edited, in order to move items on a line left/right, then you can add a hook to Code: [Select]  Lines.AddEditHandler(@DoLinesEdited); see components\synedit\synpluginmulticaret.pp for how to do that.(It is rather tricky, as you need to also catch senrTextBufferChanged, and re-register. (subject to change in future...) ---------------------------------------------------------------------- Martin_fr · 2015-03-27 15:28 Given the common nature of the issue, there probably should be a baseclass to do that. But currently there is not.