From 03f166897801c29e9357bce3214f02502eb7f252 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sat, 21 Jul 2012 12:37:00 -0400 Subject: Converted some `buffer` "get" and "set" functions into properties. Also updated to Scintilla 3.2.1. --- modules/textadept/bookmarks.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'modules/textadept/bookmarks.lua') diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua index 6284f25c..7c06ac64 100644 --- a/modules/textadept/bookmarks.lua +++ b/modules/textadept/bookmarks.lua @@ -90,13 +90,12 @@ function M.goto_bookmark() end local NCURSES_MARK = _SCINTILLA.constants.SC_MARK_CHARACTER + string.byte(' ') -if buffer then +-- Sets view properties for bookmark markers. +local function set_bookmark_properties() if NCURSES then buffer:marker_define(MARK_BOOKMARK, NCURSES_MARK) end - buffer:marker_set_back(MARK_BOOKMARK, M.MARK_BOOKMARK_COLOR) + buffer.marker_back[MARK_BOOKMARK] = M.MARK_BOOKMARK_COLOR end -events.connect(events.VIEW_NEW, function() - if NCURSES then buffer:marker_define(MARK_BOOKMARK, NCURSES_MARK) end - buffer:marker_set_back(MARK_BOOKMARK, M.MARK_BOOKMARK_COLOR) -end) +if buffer then set_bookmark_properties() end +events.connect(events.VIEW_NEW, set_bookmark_properties) return M -- cgit v1.2.3