[gedit-list] Other comment on GtkSourceView (and the turbo patch)



Hi Gustavo.

Using test-widget I have observed the following weird behavior: 
go toward the end of the document at line 1945. It should contain a
"void". 
Split the "void" into "vo id". You will observe a delay of about half a
second before the highlight is updated.
If you try to split a word with a bold weight, this delay disappears.
Any idea? I think this is due to the way GtkTextView emits "expose"
events.

In general, I think we should try to improve the response time the user
perceives while she is typing. 
I think this could be achieved by highlighting text outside the idle
worker when the user adds/deletes text in the visible area (like I did
in my patch). 

If we improve the performance of the update_syntax_regions function I
think this could be doable in all cases. Otherwise we can do it only in
the case adding/removing text does not modify the table of syntax
regions.

Is it sound for you?

There is also another bug we should try to fix (but I'm not sure how to
fix it in an efficient way).
In same cases we apply two or more patter tags to the same piece of
text. 
For example we apply two tags to "#if", the first one is applied to the
entire word, the second one to "if" only. This is clearly a bug in the
check_pattern function.
A possible way to fix it is to use the same approach we used for the
syntax tags by defining a "pattern_all" regexp (but I don't like it).
Another way could be to use GtkTextRegion. But I'm not sure about the
performance implications.
The last solution, could be to write a "has_pattern_tag" function and
apply the new pattern only if both has_pattern_tag (start_iter) an 
has_pattern_tag (end_iter) are false. This is the easiest way to fix
this bug but could have important performance drawbacks.

I don't know very well the performance of GtkTextRegion, in the case it
is fast I think that using it could be the best solution.

Lemme know what do you think.

Ciao,
Paolo

P.S. For the member of the gedit list: we are working on a branch of
GtkSourceView called "toward-gedit-integration". The result of this work
will be used to implement syntax highlight in gedit.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]