Re: [code] [textadept] Buffer/view properties

From: Robert Gieseke <>
Date: Tue, 17 Feb 2015 21:52:36 +0100

Hi Mitchell,

Am 13/02/15 um 18:03 schrieb Mitchell:
> On Fri, 13 Feb 2015, Robert Gieseke wrote:
>> Am 11/02/15 um 18:00 schrieb Mitchell:
>> [...]
>>>> As for storing the margins, this would be useful for Textredux,
>>>> textadept-vi and changing the width for buffers with 10.000s of lines.
>>>> Not sure if any styles should be stored as well.
>>> I don't think I like the idea of making margin widths and types
>>> "per-buffer". That would open the door to "why not save all properties
>>> associated with views, not buffers?"
>> I can understand this concern, but the problem is that if it's not done
>> by Textadept then the other modules need to do it themselves (probably
>> conflicting with each other or each duplicating it) or they need to
>> agree on an extra-module that needs to be installed before. There were
>> also your Lua debugger[1] and Quicknav[2] which made use of the margins.
>> All might conflict with other modules using the margins.
> Thanks for your feedback. I will consider this over the weekend.

maybe a different solution could be setting these properties after a
buffer or view switch by storing them in a buffer specific table and
looking up defaults in a meta-table if necessary? Something like

buffer._settings = {
  wrap_mode = buffer.WRAP_WORD
  margin_width_n = {0, 20}
  view_eol = false

And a respective complete meta-table for the defaults.
So instead of saving all properties on every switch, the code changing
these properties would need to store them in _settings as well if they
should persist.

Just an idea

You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Tue 17 Feb 2015 - 15:52:36 EST

This archive was generated by hypermail 2.2.0 : Wed 18 Feb 2015 - 06:32:16 EST