On Fri, 2006-02-24 at 11:43 +0100, Georg Baum wrote: > Martin Vermeer wrote: > > > Hmmm... does this cover the case where you create an ERT, insert some > > text, delete this text again and insert some new text? > > I don't remember if I tried that (will try later)
Please do ;-) > , but I think that it > covers that case. My theory is: The font of newly inserted text at the end > of a paragraph is the font of the last dummy font change in that paragraph. Yes > New paragraphs inherit the font of the owning LyXText. I am skeptical of this. > Text inserted in the > middle of a paragraph gets of course the font that is active there. > If this theory is correct, then my patch will always work. > > > My patch places a > > current_cursor stanza into doDispatch/default for this. If you do this, > > you can again dump the corresponding stanza in init(). > > I don't understand the reason for putting it there. Why change the font for > every invocation of doDispatch and not once in the constructor? Can it be > changed from outside? What happens is that the current cursor font is set to latex_language. When you then type a character, it will go through the dispatch chain to the inner LyXText, and will be inserted with this font(*)... unless it is surrounded by text having a different language, as you correctly observe above(+). But if we have closed all holes, that can never happen. - Martin (*) This works, I tested. If it didn't work, the init() stanza wouldn't work either. (+) I'm not actually sure of this... (real_)current_font may take priority anyway.
signature.asc
Description: This is a digitally signed message part
