Hi,
Hi,
Get the attached code.
For example, you can try typing the word ‘ALTER’. You’ll see that the word
will change color when you type a space after ALTER.
I wish instead of the color already changed since you can type the last
character R.
As Robin mentioned there is nothing you can do about it. This is an
implementation detail of the Scintilla lexer in question. Some lexers
apply the styles after each character others are word based parsers
which only apply the styles after completed words.
You could probably set a binding on EVT_STC_STYLENEEDED, and parse the
data and add styles however you want.
I guess ideally you want to create your own lexer, but I found very
little documentation to help me do that. I gave up and just do my
custom styling in the event handler. Works quite well, all things
considered.
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
I tried to set a binding on EVT_STC_MODIFIED but no style’s character highlight:
…
def OnEvtStcMod(self,e):
start = self.GetEndStyled() # this is the first character that needs styling
end = e.GetPosition() # this is the last character that needs styling
self.StartStyling(start, 1) # in this example, only style the text style bits
print start,end
for pos in range(start, end): # in this example, simply loop over it…
self.SetStyling(1, 34) # …and set it all to the NUMBER style
…
What’s wrong ?
Attached new code
__editortrigger.py (22 KB)
···
2010/2/18 Bryan Oakley bryan.oakley@gmail.com
On Thu, Feb 18, 2010 at 4:21 PM, Cody Precord codyprecord@gmail.com wrote:
On Thu, Feb 18, 2010 at 4:18 PM, Fabio Spadaro fabiolinospad@gmail.com wrote:
–
Fabio Spadaro
www.fabiospadaro.com