Line number margin not the same in splits as the default view

From: Ryan Pusztai <rpusz....at.gmail.com>
Date: Mon, 7 Jun 2010 10:44:40 -0400

Hi,

I added this to my init.lua file to control some defaults about all themes
and it has been working great.

-- ~/.textadept/init.lua
  local function OnBufferNew()
 local textadept = _G.textadept
local c = textadept.constants
local buffer = buffer
 -- Global tabs and indentation
buffer.tab_width = 4
buffer.use_tabs = true
 buffer.indent = 4
buffer.indentation_guides = 1
-- Multiple selection support
 buffer.multiple_selection = true
buffer.additional_selection_typing = true
 buffer.additional_carets_visible = true
-- Make line number buffer wider (4 digits)
 buffer.margin_width_n[0] = 4 + 4 * buffer:text_width( c.STYLE_LINENUMBER,
'9' )
  end

  textadept.events.add_handler( "buffer_new", OnBufferNew )
-- end ~/.textadept/init.lua

I am trying to extend the line number margin by one more character than the
default (up to 4 digits). This works great until you open a split. in the
split it goes to the default of 3 digits. Any thoughts?
Does it have to do with the indexing to '0' on "buffer.margin_width_n"? If
so, how do I make this work all the time?
Thanks.

-- 
Regards,
Ryan
Received on Mon 07 Jun 2010 - 10:44:40 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:47:31 EST