aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/bookmarks.lua11
-rw-r--r--modules/textadept/editing.lua2
-rw-r--r--modules/textadept/find.lua8
-rw-r--r--modules/textadept/mime_types.lua4
-rw-r--r--modules/textadept/run.lua4
5 files changed, 14 insertions, 15 deletions
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
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index c87bb9c7..c702d297 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -503,7 +503,7 @@ local NCURSES_MARK = _SCINTILLA.constants.SC_MARK_CHARACTER + string.byte(' ')
local function set_highlight_properties()
local buffer = buffer
if NCURSES then buffer:marker_define(MARK_HIGHLIGHT, NCURSES_MARK) end
- buffer:marker_set_back(MARK_HIGHLIGHT, M.MARK_HIGHLIGHT_BACK)
+ buffer.marker_back[MARK_HIGHLIGHT] = M.MARK_HIGHLIGHT_BACK
buffer.indic_fore[INDIC_HIGHLIGHT] = M.INDIC_HIGHLIGHT_BACK
buffer.indic_style[INDIC_HIGHLIGHT] = _SCINTILLA.constants.INDIC_ROUNDBOX
buffer.indic_alpha[INDIC_HIGHLIGHT] = M.INDIC_HIGHLIGHT_ALPHA
diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua
index 1a9d2cfb..3bd90597 100644
--- a/modules/textadept/find.lua
+++ b/modules/textadept/find.lua
@@ -58,7 +58,7 @@ find.replace_button_text = not NCURSES and _L['_Replace'] or _L['[Replace]']
find.replace_all_button_text = not NCURSES and _L['Replace _All'] or _L['[All]']
find.match_case_label_text = not NCURSES and _L['_Match case'] or _L['Case(F1)']
find.whole_word_label_text = not NCURSES and _L['_Whole word'] or _L['Word(F2)']
-find.lua_pattern_label_text = not NCURSES and _L['_Lua pattern'] or
+find.lua_pattern_label_text = not NCURSES and _L['_Lua pattern'] or
_L['Pattern(F3)']
find.in_files_label_text = not NCURSES and _L['_In files'] or _L['Files(F4)']
@@ -362,7 +362,7 @@ local function goto_file(pos, line_num)
local file, file_line_num = line:match('^(.+):(%d+):.+$')
if file and file_line_num then
buffer:marker_delete_all(MARK_FIND)
- buffer:marker_set_back(MARK_FIND, MARK_FIND_COLOR)
+ buffer.marker_back[MARK_FIND] = MARK_FIND_COLOR
buffer:marker_add(line_num, MARK_FIND)
buffer:goto_pos(buffer.current_pos)
gui.goto_file(file, true, preferred_view)
@@ -404,9 +404,9 @@ function find.goto_file_in_list(next)
end
end
-if buffer then buffer:marker_set_back(MARK_FIND, MARK_FIND_COLOR) end
+if buffer then buffer.marker_back[MARK_FIND] = MARK_FIND_COLOR end
events_connect(events.VIEW_NEW, function()
- buffer:marker_set_back(MARK_FIND, MARK_FIND_COLOR)
+ buffer.marker_back[MARK_FIND] = MARK_FIND_COLOR
end)
--[[ The functions below are Lua C functions.
diff --git a/modules/textadept/mime_types.lua b/modules/textadept/mime_types.lua
index 9efbbec9..00791efd 100644
--- a/modules/textadept/mime_types.lua
+++ b/modules/textadept/mime_types.lua
@@ -111,7 +111,7 @@ end
-- @name ws_styles
local ws_styles = {}
local SETDIRECTPOINTER = _SCINTILLA.properties.doc_pointer[2]
-local SETLEXERLANGUAGE = _SCINTILLA.functions.set_lexer_language[1]
+local SETLEXERLANGUAGE = _SCINTILLA.properties.lexer_language[2]
-- LuaDoc is in core/.buffer.luadoc.
local function set_lexer(buffer, lang)
buffer:check_global()
@@ -135,7 +135,7 @@ local function set_lexer(buffer, lang)
ws_styles[lang] = ws
end
-local GETLEXERLANGUAGE = _SCINTILLA.functions.get_lexer_language[1]
+local GETLEXERLANGUAGE = _SCINTILLA.properties.lexer_language[1]
-- LuaDoc is in core/.buffer.luadoc.
local function get_lexer(buffer, current)
buffer:check_global()
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index 450580c3..1ee64182 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -113,7 +113,7 @@ local function print_output(lexer, output)
local filename = _VIEWS[i].buffer.filename
if filename and filename:find(error_details.filename..'$') then
gui.goto_view(i)
- buffer:annotation_set_text(error_details.line - 1, error_details.message)
+ buffer.annotation_text[error_details.line - 1] = error_details.message
buffer.annotation_style[error_details.line - 1] = 8 -- error_details
return
end
@@ -191,7 +191,7 @@ function goto_error(pos, line_num)
local line, message = error_details.line, error_details.message
buffer:goto_line(line - 1)
if message then
- buffer:annotation_set_text(line - 1, message)
+ buffer.annotation_text[line - 1] = message
buffer.annotation_style[line - 1] = 8 -- error
end
end