Synedit - Highlighting of comments backgrounds after //
lazarus / 31-LCL
----------------------------------------------------------------------
Aeternitas · 2017-03-28 19:18
Hi,
I have a question. I'd like to have the full line background color of
comments in highlighting after //. I use several highlighting
components, but most important it is for SynAnySyn. I use Lazarus
1.1.99, but as I tried the actual version, it is not implemented yet.
Thank you in advance.
----------------------------------------------------------------------
Martin_fr · 2017-03-28 19:49
I don't think synanysyn is the ideal choice here.
You can modify the existing SynPasSyn. It already internally
differentiates between 3 diff comment type.
So all you need to do is add a new attribute.
1) add a property SlashCommentAttrib: TSynHighlighterAttributes
2) init it in the constructor / you will see all the others ....
3) add it in TSynPasSyn.GetTokenAttribute
for tkComment test
if rsSlash in fRange then
--------------------
If you need it independent of the highlighter search the forum for
TSynEditMarkup, and write your own code as markup
----------------------------------------------------------------------
Bart · 2017-03-28 19:52
Quote from: Aeternitas on March 28, 2017, 09:18:12 pmI use Lazarus
1.1.99
You mean Lazarus 1.1.99.0 Alpha pre-release from 2013?
Why not 1.2, or 1.4 or current release 1.6.4?
Bart
----------------------------------------------------------------------
Martin_fr · 2017-03-28 20:06
Or write your own highlighter, there is a tutorial on the wiki, and
examples in the iDE example folder
----------------------------------------------------------------------
Edson · 2017-03-28 21:23
Or use SynFacilSyn, and this XML configuration:
Code: XML [Select][+][-]window.onload = function(){var x1 =
document.getElementById("main_content_section"); if (x1) { var x =
document.getElementsByClassName("geshi");for (var i = 0; i
----------------------------------------------------------------------
Martin_fr · 2017-03-28 21:29
Quote from: Edson on March 28, 2017, 11:23:40 pmOr use SynFacilSyn,
and this XML configuration:
Out of interest, does your sample config include the following
situations (or do you need to add more config)?
// appears in string, not a comment
c:= 'a // b';
// appears in comment, not a slash/end-of-line comment
a := (* comment // description *) 1;
----------------------------------------------------------------------
Edson · 2017-03-28 21:40
Quote from: Martin_fr on March 28, 2017, 11:29:42 pm// appears in
string, not a comment
c:= 'a // b';
You need to add:
Code: XML [Select][+][-]window.onload = function(){var x1 =
document.getElementById("main_content_section"); if (x1) { var x =
document.getElementsByClassName("geshi");for (var i = 0; i
Quote from: Martin_fr on March 28, 2017, 11:29:42 pm// appears in
comment, not a slash/end-of-line comment
a := (* comment // description *) 1;
You need to add:
Code: XML [Select][+][-]window.onload = function(){var x1 =
document.getElementById("main_content_section"); if (x1) { var x =
document.getElementsByClassName("geshi");for (var i = 0; i