Re: [code] [textadept] Feature request: control characters / BOM

From: Mitchell <m.att.foicica.com>
Date: Thu, 7 Aug 2014 12:24:11 -0400 (EDT)

Hi Joshua,

On Wed, 6 Aug 2014, Joshua Krmer wrote:

> Dear list,
>
> Textadept prints control characters (like ESC or LF) in an
> inverted-colour box; but only some control characters seem to be
> respected. I miss for example the BOM (U+FEFF), ZWNJ (U+200C) and ZWJ
> (U+200D). In my eyes, every non-printable/control character should be
> shown this way; with the exception of whitespace/EOL characters, they
> should be hidden by default, but it should be possible to make them
> visible, too.

You should be able to do this via `buffer.representation`[1]. More info
can be found here[2].

> Regarding BOM, it would be nice to have a menu item to insert it at the
> beginning of the file. I would prefer the BOM to be shown as a regular
> character at the beginning of the file, instead of implementing BOM
> support as part of the file encoding, as done by some editors.

I'm no encoding expert so I'd prefer not to add that menu item or others
that users might expect (UTF-16LE, UTF-16BE, UTF-32..., etc.) I think it's
sufficient for you to add a menu item (e.g. to the Tools menu) that sets
`io.encoding_bom`.

I've never seen an editor display a BOM in the editor view. Doing so would
certainly confuse me. There's also the question of whether or not to make
the BOM char read-only. I think it's easier to avoid all of this and
simply treat the BOM behind the scenes.

Cheers,
Mitchell

[1]: http://foicica.com/textadept/api.html#buffer.representation
[2]: http://scintilla.org/ScintillaDoc.html#CharacterRepresentations

-- 
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 Thu 07 Aug 2014 - 12:24:11 EDT

This archive was generated by hypermail 2.2.0 : Fri 08 Aug 2014 - 06:54:31 EDT