Show invisible characters (tab, space, return) in field

Kaveh Bazargan kaveh at rivervalleytechnologies.com
Sat Dec 8 10:58:18 EST 2018


Thank you for spending the time on this. Like all your posts it is an
education! Great idea to convert just a visible part of text! I am going to
study well and work on this.

On the live conversion, you are adding a unicode character before a space,
say. That means two characters and therefore two character widths. Is there
a way of making spaces zero width, or the new characters overlapping the
space etc? Ideally I want the text widths of lines to be the same with and
without the visible chars.

On Sat, 8 Dec 2018 at 15:06, hh via use-livecode <
use-livecode at lists.runrev.com> wrote:

> > Kaveh wrote:
> > I need the user to edit as normal and with normal functionality but see
> the normally
> > invisible characters. So seems I would need a native solution. :-(
>
> This works for me (TMHO, this demonstrates the beauty of LC).
> Script your field with the following.
>
> on rawkeyDown k
>   switch k
>    case 32 -- space
>       put numToCodePoint(0x00B7)&numToCodePoint(0x200A) into the selection
>       break
>     case 65293 -- return
>       put numToCodePoint(0x23CE)&cr into the selection
>       break
>      case 65289 -- tab
>       -- put tab&numToCodePoint(0x21E5) into the selection -- alternate
>       put numToCodePoint(0x21E5)&tab into the selection
>       break
>     default
>       pass rawkeydown
>   end switch
> end rawkeyDown
>
> For converting the whole field *or a visible part of it* (you could use a
> check button)
> use the replace-script of my last post. For a few lines (< 500), put into
> a temporary
> field, conversion preserving styles is still fast.
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


-- 
Kaveh Bazargan
Director
River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter
<https://twitter.com/kaveh1000> • LinkedIn
<https://www.linkedin.com/in/bazargankaveh/>



More information about the use-livecode mailing list