Re: [code] [textadept]

From: Mitchell <m.att.foicica.com>
Date: Tue, 28 Aug 2018 22:39:50 -0400 (EDT)

Hi Colin,

On Tue, 28 Aug 2018, Colin wrote:

> I tried what you suggested, and it doesn't seem to be that simple. Maybe there is another option somewhere similar to "Toggle View EOL" that is required to change the visibility of these special characters?

I think Scintilla by default shows blobs for those kinds of characters, especially if they are invalid UTF-8.

> Another interesting thing: string.format("0x%x", 128), for example, produces 0x80 as I would expect when I run it in the command entry field of TA. However, when I run
>
> for i = 128, 255 do
> print(buffer.representation[string.char(i)])
> end
>
> after having run
>
> for i = 128, 255 do
> buffer.representation[string.char(i)] = string.format("0x%x", i)
> end
>
> in my init file, the representations for i = 128, 255 have been stripped of their leading zero. No matter what I have tried I can't make that leading zero stick when assigning the string to buffer.representation. Maybe that has something to do with it.

Here's what I did:

1. Start Textadept from scratch.
2. Open the command entry and typed: `for i=128,255 do print(string.char(i)) end` and pressed Enter.
3. At this point I have a bunch of blobs showing "x80", "x81", ..., "xFF".
4. Open the command entry again and typed: `for i=128,255 do buffer.representation[string.char(i)]=string.format('0x%x',i) end` and pressed Enter.
5. Now my blobs have changed to show '0x80', '0x81', ..., '0xff' (note the lower-case).

Note this was sort of the reverse of what you did. Somehow I managed to get the "0x" prefix to "stick" that way.

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 28 Aug 2018 - 22:39:50 EDT

This archive was generated by hypermail 2.2.0 : Wed 29 Aug 2018 - 06:26:37 EDT