Re: [code] Re: [textadept] issues with closing buffers

From: Mitchell <m.att.foicica.com>
Date: Wed, 1 Oct 2014 10:26:06 -0400 (EDT)

Hi Joshua,

On Mon, 29 Sep 2014, Joshua Krmer wrote:

> On 2014-09-11, 10:35, Mitchell wrote:
>
>> Thanks for the report. This will be fixed in the next nightly or two.
>
> I have tested the latest nightly today and found that scroll position
> and cursor position are correctly preserved, but the wrap mode setting
> is still lost when closing a buffer.
>
> It can be reproduced as follows: Change wrap mode (Ctrl Alt
> Backslash), open a new buffer (Ctrl n), close the new buffer (Ctrl w).
> The wrap mode will then be reverted to the default setting in the
> previous buffer.

Scintilla (the editing component Textadept uses) does not store the wrap
mode setting per-buffer, but rather per-view. When you create a new
buffer, Textadept reads from a properties.lua file, which may set
`buffer.WRAP_MODE`. If so, this new setting is used for the view and all
buffers within it. (Otherwise, the new buffer inherits the current
buffer's wrap settings.) I prefer not to start saving these kinds of
per-view settings per-buffer because of Scintilla's architecture. Instead,
you can put the following in your `~/.textadept/init.lua` if you'd like to
override your properties.lua's wrap setting for a particular file/lexer:

     events.connect(events.LEXER_LOADED, function(lexer)
       if lexer == 'text' then buffer.wrap_mode = buffer.WRAP_WORD end
     end)

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 Wed 01 Oct 2014 - 10:26:06 EDT

This archive was generated by hypermail 2.2.0 : Thu 02 Oct 2014 - 06:51:14 EDT