aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-03-26 17:37:08 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-03-26 17:37:08 -0400
commit940732342827ebe0d3bb98740419f621f9c77391 (patch)
tree32a3a6ac703429ca036e73c5215bac4f87b0818f /init.lua
parent52b0ec63792b3023b4ab42e42d2ce1e1fcb813bc (diff)
downloadtextadept-940732342827ebe0d3bb98740419f621f9c77391.tar.gz
textadept-940732342827ebe0d3bb98740419f621f9c77391.zip
Switched to 1-based indices for buffer positions, lines, and countable entities.
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/init.lua b/init.lua
index a7352cba..050c55d6 100644
--- a/init.lua
+++ b/init.lua
@@ -142,28 +142,28 @@ buffer.caret_line_visible = not CURSES
--buffer.margin_left =
--buffer.margin_right =
-- Line Number Margin.
-buffer.margin_type_n[0] = buffer.MARGIN_NUMBER
+buffer.margin_type_n[1] = buffer.MARGIN_NUMBER
local function resize_line_number_margin()
-- This needs to be evaluated dynamically since themes/styles can change.
local buffer = _G.buffer
local width = math.max(4, #tostring(buffer.line_count)) *
buffer:text_width(buffer.STYLE_LINENUMBER, '9') + (not CURSES and 4 or 0)
- buffer.margin_width_n[0] = math.max(buffer.margin_width_n[0], width)
+ buffer.margin_width_n[1] = math.max(buffer.margin_width_n[1], width)
end
events.connect(events.BUFFER_NEW, resize_line_number_margin)
events.connect(events.VIEW_NEW, resize_line_number_margin)
events.connect(events.FILE_OPENED, resize_line_number_margin)
-- Marker Margin.
-buffer.margin_width_n[1] = not CURSES and 4 or 1
+buffer.margin_width_n[2] = not CURSES and 4 or 1
-- Fold Margin.
-buffer.margin_width_n[2] = not CURSES and 12 or 1
-buffer.margin_mask_n[2] = buffer.MASK_FOLDERS
+buffer.margin_width_n[3] = not CURSES and 12 or 1
+buffer.margin_mask_n[3] = buffer.MASK_FOLDERS
-- Other Margins.
-for i = 1, buffer.margins - 1 do
+for i = 2, buffer.margins do
buffer.margin_type_n[i] = buffer.MARGIN_SYMBOL
buffer.margin_sensitive_n[i] = true
buffer.margin_cursor_n[i] = buffer.CURSORARROW
- if i > 2 then buffer.margin_width_n[i] = 0 end
+ if i > 3 then buffer.margin_width_n[i] = 0 end
end
-- Annotations.