Ok I figured this one out too. Combination of weird behavior and a bug.
scintilla.GetRange(0, nTrimLength).Text = ""; does delete the text, but NOT if the ReadOnly attribute is true.
BUT, when you call ReplaceTarget, even though no text is replaced, it still returns the "number of characters replaced" as the number of characters you wanted to replace. So it makes you think it worked, but it didn't. This is just odd and I would consider this to be a bug.
So to handle it I just wrote up a DeleteRange method that removes the readonly attribute and re-adds it if necessary. This really shouldn't be necessary though imo.
scintilla.GetRange(0, nTrimLength).Text = ""; does delete the text, but NOT if the ReadOnly attribute is true.
BUT, when you call ReplaceTarget, even though no text is replaced, it still returns the "number of characters replaced" as the number of characters you wanted to replace. So it makes you think it worked, but it didn't. This is just odd and I would consider this to be a bug.
So to handle it I just wrote up a DeleteRange method that removes the readonly attribute and re-adds it if necessary. This really shouldn't be necessary though imo.