aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2012-07-16 15:13:46 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2012-07-16 15:13:46 -0400
commitee416479a1b990a325d98f77b07b360c7b025c53 (patch)
treec1318940728731047587b5a0c47f32a4900427ae /modules
parent3d718af477180031d94434ab6372e889174ba7c1 (diff)
downloadtextadept-ee416479a1b990a325d98f77b07b360c7b025c53.tar.gz
textadept-ee416479a1b990a325d98f77b07b360c7b025c53.zip
Support bookmarks in ncurses; modules/textadept/bookmarks.lua
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/bookmarks.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua
index 4219da58..6284f25c 100644
--- a/modules/textadept/bookmarks.lua
+++ b/modules/textadept/bookmarks.lua
@@ -9,7 +9,7 @@ local M = {}
-- The color used for a bookmarked line in `0xBBGGRR` format.
module('_M.textadept.bookmarks')]]
-M.MARK_BOOKMARK_COLOR = 0xB3661A
+M.MARK_BOOKMARK_COLOR = not NCURSES and 0xB3661A or 0xFF0000
local MARK_BOOKMARK = _SCINTILLA.next_marker_number()
@@ -89,8 +89,13 @@ function M.goto_bookmark()
if line then _M.textadept.editing.goto_line(line:match('^%d+')) end
end
-if buffer then buffer:marker_set_back(MARK_BOOKMARK, M.MARK_BOOKMARK_COLOR) end
+local NCURSES_MARK = _SCINTILLA.constants.SC_MARK_CHARACTER + string.byte(' ')
+if buffer then
+ if NCURSES then buffer:marker_define(MARK_BOOKMARK, NCURSES_MARK) end
+ buffer:marker_set_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)