Neil Hodgson wrote:
Robert Roessler:
...
Put a different way, I am now re-initializing each Scintilla [widget]
instance, doing all of the style_clear_all, set_margin_mask_n,
set_code_page, the style_set_* calls, etc each time a new tab (with
its own Scintilla widget) is created... is this all required, or can
you mention any settings that do *not* need to be done for each new
instance? The Scintilla "properties" facility comes to mind for me,
for instance, as something that might be shared across instances.
No, all user visible aspects should be set up again. Its only stuff
like caches and locks that is shared and they should be invisible in
terms of functionality to your code.
Thanks again, Neil - I have been [possibly] overly sensitive to this
partly because of speed, as it costs ~.14 secs to parse the
.properties (from a SciTE-style file) and set up all of the styles etc
for the caml Scintilla lexer (which I consider hefty)... then I just
now isolated >90% of this time to ONLY the following:
editor#set_margin_width_n 0
(if get_prop_int p_t "line.numbers" > 0 then
(editor#text_width sci_STYLE_LINENUMBER "_9999") else 0)
While this is in OCaml, this should still look somewhat like the
"official" suggested approach for setting the line# margin width...
note that this is *after* all of the other styling setup is done but
*before* a caml file is loaded into the instance.
WITH the above margin-setting code, full style setup = 0.14 secs,
WITHOUT the above, full style [parsing and] setup = 0 - 0.01 secs
(which is the resolution for the timing method I am using).
FURTHER refining of the test shows (as you probably already know) that
ALL of the [measurable] time is going to the text_width call!
Does this suggest [maybe] that it would be nice to have a faster
(read: quick and dirty) way of estimating a believable width for the
line numbers column? :)
Robert Roessler
[EMAIL PROTECTED]
http://www.rftp.com
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest