On Sun, 10 Mar 2013, Beno?t Minisini wrote: > Le 09/03/2013 20:11, Tobias Boege a ?crit : > > On Sat, 09 Mar 2013, Beno?t Minisini wrote: > >> Le 09/03/2013 18:10, Tobias Boege a ?crit : > >>> Hi, > >>> > >>> the attached project shows how just for line 0, the > >>> Editor.Lines[0].Refresh() method does not force the Highlight event to > >>> kick > >>> in (if I have Editor.Highlight = Highlight.Custom set). > >>> > >>> Is there a reason or is it just a bug? > >>> > >>> Regards, > >>> Tobi > >>> > >> > >> Refresh() just triggers a GUI redraw. It has nothing to do with the > >> Highlight event, that is raised when the editor decides. > >> > > > > Alright. It looked like it did force a Highlight event with all the other > > line numbers but ok... I now get what I want by resetting Editor.Highlight > > and then Editor.Goto() one line back and forth. Not really beautiful but > > seems to work consistently. > > > > In case anyone wonders: I'm implementing kind of Editor.ShowString() and > > Replace$() for use with regular expressions. This requires highlighting the > > entire text again with a new search query. The Editor doesn't really fit my > > needs (as my hack above shows) but out of all controls it comes the most > > close to it I think... > > > > Regards, > > Tobi > > > > I don't understand what you want to do exactly with Editor. Could you > explain with more details? >
Of course. I wasn't clear at all. The goal is to enter a regular expression and then highlight all matching strings in a text (like Editor.ShowString() does for fixed strings). One may also replace all matches by another string (currently not containing submatches of the original expression because it was just a POC for an article about gb.pcre). I'd just leave this task to an invocation of 'sed'. BTW, I finished the thing yesterday and the attached code may show better what I was trying to explain. Regards, Tobi
regex_search_replace-1.0.1.tar.gz
Description: Binary data
------------------------------------------------------------------------------ Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user