Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Help trying to style string internally.

Received: by 10.204.127.19 with SMTP id e19mr9023276bks.4.1351769157559;
        Thu, 01 Nov 2012 04:25:57 -0700 (PDT)
X-BeenThere: scintilla-interest@googlegroups.com
Received: by 10.204.0.70 with SMTP id 6ls2998227bka.2.gmail; Thu, 01 Nov 2012
 04:25:56 -0700 (PDT)
Received: by 10.204.129.9 with SMTP id m9mr9021429bks.1.1351769156495;
        Thu, 01 Nov 2012 04:25:56 -0700 (PDT)
Received: by 10.204.129.9 with SMTP id m9mr9021428bks.1.1351769156477;
        Thu, 01 Nov 2012 04:25:56 -0700 (PDT)
Return-Path: <gclsd-scintilla-interes...@m.gmane.org>
Received: from plane.gmane.org (plane.gmane.org. [80.91.229.3])
        by gmr-mx.google.com with ESMTPS id l1si576524bka.2.2012.11.01.04.25.56
        (version=TLSv1/SSLv3 cipher=OTHER);
        Thu, 01 Nov 2012 04:25:56 -0700 (PDT)
Received-SPF: pass (google.com: domain of gclsd-scintilla-interes...@m.gmane.org designates 80.91.229.3 as permitted sender) client-ip=80.91.229.3;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of gclsd-scintilla-interes...@m.gmane.org designates 80.91.229.3 as permitted sender) smtp.mail=gclsd-scintilla-interes...@m.gmane.org
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gclsd-scintilla-interes...@m.gmane.org>)
	id 1TTsuR-0006SJ-Pe
	for scintilla-interest@googlegroups.com; Thu, 01 Nov 2012 12:26:03 +0100
Received: from aaubervilliers-652-1-7-77.w81-249.abo.wanadoo.fr ([81.249.166.77])
        by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <scintilla-interest@googlegroups.com>; Thu, 01 Nov 2012 12:26:03 +0100
Received: from PhiLho by aaubervilliers-652-1-7-77.w81-249.abo.wanadoo.fr with local (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <scintilla-interest@googlegroups.com>; Thu, 01 Nov 2012 12:26:03 +0100
X-Injected-Via-Gmane: http://gmane.org/
To: scintilla-interest@googlegroups.com
From: Philippe Lhoste <Phi...@GMX.net>
Subject: Re: [Lexer] Help trying to style string internally.
Date: Thu, 01 Nov 2012 12:25:27 +0100
Lines: 37
Message-ID: <k6tm7p$8e...@ger.gmane.org>
References: <cb7e53ac-c4ac-4617-9f6d-46ad5313eca8@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: use...@ger.gmane.org
X-Gmane-NNTP-Posting-Host: aaubervilliers-652-1-7-77.w81-249.abo.wanadoo.fr
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1
In-Reply-To: <cb7e53ac-c4ac-4617-9f6d-46ad5313eca8@googlegroups.com>
X-Antivirus: avast! (VPS 121031-1, 31/10/2012), Outbound message
X-Antivirus-Status: Clean

On 31/10/2012 00:28, RaptorX wrote:
> I have been advancing with my lexer and it is going real well. Now there
> is something I would like to do but I am not sure how to approach it.
> I want my Lexer to style any string contained in
> two asterisks characters and:
>
> 1) remove the asterisks
> 2) convert string to bold
>
> I would like to be able to do that internally, that means not setting up
> a Style state where the user would do that manually.
>
> Can you point me in to the functions I would be using for this?
> Up to now I have been using a lot of sc.Match, sc.SetState,
> sc.ChangeState and others but I am sure this is not the correct approach
> for this problem.

I answered this yesterday, but I don't see my answer here...

Anyway, my answer was: no, a lexer cannot change the text in the buffer, 
or at least it should not do it.
And it sets style ids, but it doesn't choose how a style is rendered. 
That's the task of Scintilla, following the settings set by its client.

It is about a source code editor, not a rich text editor: if, for 
example, you do a markup lexer, you can be tempted to hide the 
characters of the markup and show the appropriate rendering, but then it 
would be hard to manually remove or change the markup. It would be the 
task of the client to offer commands to do so... But, again, that's the 
wrong component to use for this task.

-- 
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  http://PhiLho.deviantART.com
--  --  --  --  --  --  --  --  --  --  --  --  --  --