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

From: Mitchell <m.att.foicica.com>
Date: Sat, 9 Aug 2014 11:22:34 -0400 (EDT)

Hi Joshua,

On Sat, 9 Aug 2014, Joshua Krmer wrote:

> On 2014-08-09, 9:37, Mitchell wrote:
>
>> `buffer.representation` is "indexable" and acts like an already
>> existing table:
>>
>> buffer.representation['\xe2\x84\xa6'] = 'U+2126 \xe2\x84\xa6'
>
> I see ... thanks. However, there seems to be a problem. It does not
> work in the first buffer when I open Textadept. If I create a new
> buffer, the setting is in effect in this new buffer. But when I switch
> to another buffer and switch back, the setting is no longer in effect.
>
> I've put the line in my ~/.textadept/properties.lua file. Other
> settings in this file, like "buffer.tab_width = 4", do not show this
> behaviour.

Yes, it seems that Scintilla treats character representations differently
than typical buffer properties. After some experimentation, placing the
following in my *~/.textadept/init.lua* seems to work:

   local function set_reprs()
     buffer.representation['\xe2\x84\xa6'] = 'U+2126 \xe2\x84\xa6'
   end
   events.connect(events.BUFFER_AFTER_SWITCH, set_reprs)
   events.connect(events.VIEW_NEW, set_reprs)

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 Sat 09 Aug 2014 - 11:22:34 EDT

This archive was generated by hypermail 2.2.0 : Sun 10 Aug 2014 - 06:34:38 EDT