Recent

Author Topic: What setting tells SynEdit to highlight "same" words where the cursor is?  (Read 4327 times)

RedOctober

  • Sr. Member
  • ****
  • Posts: 452
I'd like my TSynEdit to work like Lazarus in that when I click my cursor in a word, after a short time, all other occurrences of the same word are highlighted as well (in this case light gray background).

I can't find the setting to tell my TSynEdit to do that.

My TSynEdit's "Beautifier" property is set to itself.  Is that correct?

I'm using Lazarus 1.8.2 FPC 3.0.4, SynEdit 1.0 (the one that comes default with Lazarus 1.8.2)

Edson

  • Hero Member
  • *****
  • Posts: 1301
There is a sample in "La Biblia del SynEdit": http://blog.pucp.edu.pe/blog/tito/wp-content/uploads/sites/610/2015/09/La-Biblia-del-SynEdit-Rev5.pdf:

Code: Pascal  [Select][+][-]
  1. uses ... , SynEditMarkupHighAll;
  2. ...
  3. var
  4.   SynMarkup: TSynEditMarkupHighlightAllCaret;
  5. begin
  6.   //Inicia resaltado de palabras iguales
  7.   SynMarkup := TSynEditMarkupHighlightAllCaret(
  8.                    SynEdit1.MarkupByClass[TSynEditMarkupHighlightAllCaret]);
  9.   SynMarkup.MarkupInfo.Background := clAqua;
  10.  
  11.   SynMarkup.WaitTime := 250; // tiempo en millisegundos
  12.   SynMarkup.Trim := True;    
  13.   SynMarkup.FullWord:= True; //solo marcará coincidencia en palabra completa
  14.  
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

 

TinyPortal © 2005-2018