Forum > SynEdit

TSynEditMarkupHighlightAllMulti / multiline

(1/2) > >>

BubikolRamios:
suppose I have this in synedit, i.e. multiline:

--- Quote ---abc abc
abc

--- End quote ---


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var  YourMarkup:TSynEditMarkupHighlightAllMulti;        begin  YourMarkup := TSynEditMarkupHighlightAllMulti.create(SynEdit1);  SynEdit1.MarkupManager.AddMarkUp(YourMarkup);      YourMarkup.AddSearchTerm('abc abcabc');  
Should paint entire text (my desire), does not.

Any suggestion how to get painted all, maybe changing TSynEditMarkupHighlightAllMulti to something else ?

tested (does not work):

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---YourMarkup.AddSearchTerm('abc abc' + chr(13) + chr(10) + 'abc');     


Martin_fr:
The TSynEditMarkupHighlightAllMulti does not support multi-line.

afaik only the TSynEditMarkupHighlightAll does. (But it accepts only one search term)

BubikolRamios:
hmm, should that work ? it does not.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var  YourMarkup:TSynEditMarkupHighlightAll;  options: TSynSearchOptions;begin      YourMarkup := TSynEditMarkupHighlightAll.create(SynEdit1);   SynEdit..MarkupManager.AddMarkUp(YourMarkup);   YourMarkup.SearchString:='foo';  YourMarkup.MarkupInfo.Background := ATStringProc_HtmlColor.SHtmlColorToColor('#fff000');  YourMarkup.MarkupInfo.Foreground := clBlack;  YourMarkup.MarkupInfo.Style := [fsUnderline];   options := [];  Include(options,ssoRegExprMultiLine);  Include(options,ssoFindContinue);  YourMarkup.SearchOptions := options;   

Martin_fr:
A reg-exp does not ignore line breaks.
It matches them with \r and \n.

I haven't tested, but something like

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---YourMarkup.SearchString:='f[\r\n]*o[\r\n]*o';

BubikolRamios:
for some reason \r\n does not work i.e. no coloring at all


--- Quote ---f
o

--- End quote ---

This has same/some effect, but coloring is strange

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---YourMarkup.SearchString:='f'+ sLineBreak + 'o';YourMarkup.SearchString:='f'+ #13#10 + 'o'; 
Will open new thread, as I'm going to drop idea of built in highlighters.

Navigation

[0] Message Index

[#] Next page

Go to full version