Neil Hodgson wrote: >> Andrew Howell wrote: >> >> can we use WordChars or WhitespaceChars in Lua? >> >> They seem to be write only properties (reading throws an error) >> although I've a feeling that setting them isn't actually doing >> anything (it doesn't throw an error though.) > > They are write-only properties. Its most likely your changes are > being overwritten by .properties files being reevaluated so you could > try resetting them in OnOpen or OnSwitchFile handlers.
I don't think it's reevaluated properties, I wasn't correct to say it isn't doing anything. It's making it behave unexpectedly. With the following script (CRLF EOLs) -------------------------------- output:ClearAll() -- FOO_BAR editor:SetCharsDefault() editor.WordChars="FOBAR" print(editor:WordEndPosition(25, true)) -------------------------------- I'm looking for the end of "FOO" in "FOO_BAR". I'm expecting to see 27 in the output window but I'm getting 25. If I comment out the line where I set WordChars it returns 31 so WordEndPosition() seems to use WordChars OK but not once I've altered it. As an aside, is there any way I can get hold of what is in WordChars? What I'd like to have done is set them default, then display them for a clue to what I'd done wrong. -- regards Andrew Howell _____________________________________________________________________ The contents of this email may be priviledged and are confidential. It may not be disclosed to or used by anyone other than the addressee(s), nor copied in any way. If received in error, please advise the sender, then delete it from your system. This message has been checked for all known viruses by the MessageLabs Virus Control Centre. _______________________________________________ Scite-interest mailing list [email protected] http://mailman.lyra.org/mailman/listinfo/scite-interest
