Re: [code] [textadept]

From: Colin <colin.holzman.att.protonmail.com>
Date: Tue, 28 Aug 2018 20:08:14 +0000

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?

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.

Thanks for your help.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On August 9, 2018 11:39 AM, Mitchell <m.att.foicica.com> wrote:

> Hi Colin,
>
> On Thu, 9 Aug 2018, Colin wrote:
>
> > Hi all,
> > I'm wondering if it is possible to have textadept show all characters in a file. Notepad++ has an option to "show all symbols" (or something similar) which shows all characters in a way similar to how textadept handles EOL characters. The specific issue that I had was a BOM had slipped into the middle of my file and was causing problems with another application. There are other ways to fix the problem, but I would love to be able to view all characters, including those that are not printable, within textadept.
> > I was unable to find a built in setting or module that does this. I would be happy to develop a module but I don't know where to start.
> > Any help is appreciated.
>
> You can probably use`buffer.representation`[1]. Perhaps something like this in your ~/.textadept/init.lua would work:
>
> for i = 128, 255 do
> buffer.representation[string.char(i)] = string.format('0x%X', i)
> end
>
> A BOM in the middle of a document should show up like "[0xEF][0xBB][0xBF]" where "[x]" is x shown in a box like [LF] and [CR].
>
> Cheers,
> Mitchell
>
> [1]: https://foicica.com/textadept/api.html#buffer.representation
>
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> 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.

-- 
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 - 16:08:14 EDT

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