Missing function selectedWords/selectedTrueWords

Mark Waddingham mark at livecode.com
Fri Aug 31 15:22:32 EDT 2018


On 2018-08-31 19:47, Tore Nilsen via use-livecode wrote:
> This information is useful if you want to implement changes to the
> styles of the selected text, where textStyles report mixed. In a
> selection with mixed styles, setting the textStyle has to be done on a
> word by word basis (or char by char basis if different styles are used
> within a word).

You can actually manipulate individual textStyles for just this 
purposes:

   set the textStyle["bold"] of <chunk> to true -- or false

All styled text editors I know of work on the complete selected range 
(including whitespace), rather than just on the words...

Warmest Regards,

Mark.

P.S. I'm not saying that 'the wordIndex of <chunk>' might not be useful, 
but I do wonder if the above actually solves your problem in an easier / 
more consistent with the rest-of-the-world way ;)

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list