aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/lua/adeptsensedoc.lua3
-rw-r--r--modules/textadept/adeptsense.lua2
-rw-r--r--modules/textadept/bookmarks.lua2
-rw-r--r--modules/textadept/editing.lua10
-rw-r--r--modules/textadept/find.lua11
-rw-r--r--modules/textadept/keys.lua10
-rw-r--r--modules/textadept/menu.lua11
-rw-r--r--modules/textadept/run.lua2
-rw-r--r--modules/textadept/snippets.lua2
9 files changed, 26 insertions, 27 deletions
diff --git a/modules/lua/adeptsensedoc.lua b/modules/lua/adeptsensedoc.lua
index 7bcd57a5..e31e1858 100644
--- a/modules/lua/adeptsensedoc.lua
+++ b/modules/lua/adeptsensedoc.lua
@@ -205,7 +205,8 @@ function M.start(doc)
local module = m.name
if not m.fake then
-- Tag the module and write the apidoc.
- write_tag(ctags, module, 'm', '')
+ local ext_fields = module ~= 'buffer' and '' or 'inherits:_SCINTILLA.constants'
+ write_tag(ctags, module, 'm', ext_fields)
if module:find('%.') then
-- Tag the last part of the module as a table of the first part.
local parent, child = module:match('^(.-)%.([^%.]+)$')
diff --git a/modules/textadept/adeptsense.lua b/modules/textadept/adeptsense.lua
index 283e7576..8a32f290 100644
--- a/modules/textadept/adeptsense.lua
+++ b/modules/textadept/adeptsense.lua
@@ -826,7 +826,7 @@ function M.goto_ctag(sense, kind, title)
if not tonumber(line) then
-- /^ ... $/
buffer.target_start, buffer.target_end = 0, buffer.length
- buffer.search_flags = _SCINTILLA.constants.SCFIND_REGEXP
+ buffer.search_flags = buffer.SCFIND_REGEXP
if buffer:search_in_target(line:sub(2, -2)) >= 0 then
buffer:goto_pos(buffer.target_start)
end
diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua
index f3f2f1e1..e1d84ea0 100644
--- a/modules/textadept/bookmarks.lua
+++ b/modules/textadept/bookmarks.lua
@@ -67,7 +67,7 @@ function M.goto_mark(next)
end
end
-local CURSES_MARK = _SCINTILLA.constants.SC_MARK_CHARACTER + string.byte(' ')
+local CURSES_MARK = buffer.SC_MARK_CHARACTER + string.byte(' ')
-- Sets view properties for bookmark markers.
local function set_bookmark_properties()
if CURSES then buffer:marker_define(MARK_BOOKMARK, CURSES_MARK) end
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 5042a248..19d3587c 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -227,10 +227,9 @@ function M.autocomplete_word(default_words)
end
local patt = '^['..buffer.word_chars..']+'
buffer.target_start, buffer.target_end = 0, buffer.length
- buffer.search_flags = _SCINTILLA.constants.SCFIND_WORDSTART
+ buffer.search_flags = buffer.SCFIND_WORDSTART
if not buffer.auto_c_ignore_case then
- buffer.search_flags = buffer.search_flags +
- _SCINTILLA.constants.SCFIND_MATCHCASE
+ buffer.search_flags = buffer.search_flags + buffer.SCFIND_MATCHCASE
end
local match_pos = buffer:search_in_target(root)
while match_pos ~= -1 do
@@ -495,8 +494,7 @@ function M.highlight_word()
end
if s == e then return end
local word = buffer:text_range(s, e)
- buffer.search_flags = _SCINTILLA.constants.SCFIND_WHOLEWORD +
- _SCINTILLA.constants.SCFIND_MATCHCASE
+ buffer.search_flags = buffer.SCFIND_WHOLEWORD + buffer.SCFIND_MATCHCASE
buffer.target_start, buffer.target_end = 0, buffer.length
while buffer:search_in_target(word) > -1 do
local len = buffer.target_end - buffer.target_start
@@ -509,7 +507,7 @@ end
-- Sets view properties for highlighted word indicators and markers.
local function set_highlight_properties()
buffer.indic_fore[INDIC_HIGHLIGHT] = buffer.property_int[M.HIGHLIGHT_COLOR]
- buffer.indic_style[INDIC_HIGHLIGHT] = _SCINTILLA.constants.INDIC_ROUNDBOX
+ buffer.indic_style[INDIC_HIGHLIGHT] = buffer.INDIC_ROUNDBOX
buffer.indic_alpha[INDIC_HIGHLIGHT] = 255
if not CURSES then buffer.indic_under[INDIC_HIGHLIGHT] = true end
end
diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua
index 50b557ba..cb0bd449 100644
--- a/modules/textadept/find.lua
+++ b/modules/textadept/find.lua
@@ -115,10 +115,9 @@ local escapes = {
local function find_(text, next, flags, no_wrap, wrapped)
if text == '' then return end
if not flags then
- local c = _SCINTILLA.constants
flags = 0
- if M.match_case then flags = flags + c.SCFIND_MATCHCASE end
- if M.whole_word then flags = flags + c.SCFIND_WHOLEWORD end
+ if M.match_case then flags = flags + buffer.SCFIND_MATCHCASE end
+ if M.whole_word then flags = flags + buffer.SCFIND_WHOLEWORD end
if M.lua then flags = flags + 8 end
if M.in_files then flags = flags + 16 end
end
@@ -183,7 +182,7 @@ local function find_incremental(text, next, anchor)
M.incremental_start = buffer.current_pos + (next and 1 or -1)
end
buffer:goto_pos(M.incremental_start or 0)
- find_(text, next, M.match_case and _SCINTILLA.constants.SCFIND_MATCHCASE or 0)
+ find_(text, next, M.match_case and buffer.SCFIND_MATCHCASE or 0)
end
---
@@ -360,11 +359,11 @@ function M.goto_file_found(line, next)
if next then buffer:line_end() else buffer:home() end
buffer:search_anchor()
local f = buffer['search_'..(next and 'next' or 'prev')]
- local pos = f(buffer, _SCINTILLA.constants.SCFIND_REGEXP, '^.+:[0-9]+:.+$')
+ local pos = f(buffer, buffer.SCFIND_REGEXP, '^.+:[0-9]+:.+$')
if pos == -1 then
buffer:goto_line(next and 0 or buffer.line_count)
buffer:search_anchor()
- pos = f(buffer, _SCINTILLA.constants.SCFIND_REGEXP, '^.+:[0-9]+:.+$')
+ pos = f(buffer, buffer.SCFIND_REGEXP, '^.+:[0-9]+:.+$')
end
if pos == -1 then if CURSES then view:goto_buffer(cur_buf) end return end
line = buffer:line_from_position(pos)
diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua
index 17c403ea..c81f3602 100644
--- a/modules/textadept/keys.lua
+++ b/modules/textadept/keys.lua
@@ -305,7 +305,7 @@ constantize_menu_buffer_functions() -- for the first buffer
local _M, keys, buffer, view = _M, keys, buffer, view
local m_editing, utils = _M.textadept.editing, M.utils
-local OSX, CURSES, c = OSX, CURSES, _SCINTILLA.constants
+local OSX, CURSES = OSX, CURSES
-- Windows and Linux key bindings.
--
@@ -516,9 +516,9 @@ if CURSES then keys.mT = keys.mt end -- in case mt is used by GUI terminals
keys[not OSX and (not CURSES and 'cai' or 'mi')
or 'ci'] = m_editing.convert_indentation
-- EOL Mode.
--- TODO: {utils.set_eol_mode, c.SC_EOL_CRLF}
--- TODO: {utils.set_eol_mode, c.SC_EOL_CR}
--- TODO: {utils.set_eol_mode, c.SC_EOL_LF}
+-- TODO: {utils.set_eol_mode, buffer.SC_EOL_CRLF}
+-- TODO: {utils.set_eol_mode, buffer.SC_EOL_CR}
+-- TODO: {utils.set_eol_mode, buffer.SC_EOL_LF}
-- Encoding.
-- TODO: {utils.set_encoding, 'UTF-8'}
-- TODO: {utils.set_encoding, 'ASCII'}
@@ -552,7 +552,7 @@ if not CURSES then
{utils.toggle_property, 'indentation_guides'}
keys[not OSX and 'caS' or 'cS'] = {utils.toggle_property, 'view_ws'}
keys[not OSX and 'caV' or 'cV'] =
- {utils.toggle_property, 'virtual_space_options', c.SCVS_USERACCESSIBLE}
+ {utils.toggle_property, 'virtual_space_options', buffer.SCVS_USERACCESSIBLE}
end
keys[not OSX and not CURSES and 'c=' or 'm='] = buffer.zoom_in
keys[not OSX and not CURSES and 'c-' or 'm-'] = buffer.zoom_out
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua
index 5af1f0a9..0810b15b 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -13,7 +13,7 @@ module('_M.textadept.menu')]]
local _L, _M, buffer, view = _L, _M, buffer, view
local m_editing, utils = _M.textadept.editing, _M.textadept.keys.utils
-local SEPARATOR, c = {''}, _SCINTILLA.constants
+local SEPARATOR = {''}
-- The default main menubar.
local menubar = {
@@ -145,9 +145,9 @@ local menubar = {
{_L['_Convert Indentation'], m_editing.convert_indentation},
},
{ title = _L['_EOL Mode'],
- {_L['CRLF'], {utils.set_eol_mode, c.SC_EOL_CRLF}},
- {_L['CR'], {utils.set_eol_mode, c.SC_EOL_CR}},
- {_L['LF'], {utils.set_eol_mode, c.SC_EOL_LF}},
+ {_L['CRLF'], {utils.set_eol_mode, buffer.SC_EOL_CRLF}},
+ {_L['CR'], {utils.set_eol_mode, buffer.SC_EOL_CR}},
+ {_L['LF'], {utils.set_eol_mode, buffer.SC_EOL_LF}},
},
{ title = _L['E_ncoding'],
{_L['_UTF-8 Encoding'], {utils.set_encoding, 'UTF-8'}},
@@ -179,7 +179,8 @@ local menubar = {
{utils.toggle_property, 'indentation_guides'}},
{_L['Toggle View White_space'], {utils.toggle_property, 'view_ws'}},
{_L['Toggle _Virtual Space'],
- {utils.toggle_property, 'virtual_space_options', c.SCVS_USERACCESSIBLE}},
+ {utils.toggle_property, 'virtual_space_options',
+ buffer.SCVS_USERACCESSIBLE}},
SEPARATOR,
{_L['Zoom _In'], buffer.zoom_in},
{_L['Zoom _Out'], buffer.zoom_out},
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index 0e9913ed..7e0dc83b 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -244,7 +244,7 @@ events.connect(events.DOUBLE_CLICK, function(pos, line)
if is_msg_buf(buffer) then M.goto_error(line) end
end)
-local CURSES_MARK = _SCINTILLA.constants.SC_MARK_CHARACTER + string.byte(' ')
+local CURSES_MARK = buffer.SC_MARK_CHARACTER + string.byte(' ')
-- Sets view properties for error markers.
local function set_error_properties()
if CURSES then buffer:marker_define(MARK_ERROR, CURSES_MARK) end
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua
index 9c873297..e25f7a81 100644
--- a/modules/textadept/snippets.lua
+++ b/modules/textadept/snippets.lua
@@ -368,7 +368,7 @@ M._snippet_mt = {
end,
}
-local INDIC_HIDDEN = _SCINTILLA.constants.INDIC_HIDDEN
+local INDIC_HIDDEN = buffer.INDIC_HIDDEN
if buffer then buffer.indic_style[INDIC_SNIPPET] = INDIC_HIDDEN end
events.connect(events.VIEW_NEW,
function() buffer.indic_style[INDIC_SNIPPET] = INDIC_HIDDEN end)