aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/editing.lua
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept/editing.lua')
-rw-r--r--modules/textadept/editing.lua20
1 files changed, 9 insertions, 11 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index cc9dcc25..a27a565b 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -26,6 +26,14 @@ HIGHLIGHT_BRACES = true
AUTOINDENT = true
-- end settings
+-- Comment strings for various lexer languages.
+-- Used for the block_comment function.
+-- This table is typically populated by language-specific modules.
+-- @class table
+-- @name comment_string
+-- @see block_comment
+comment_string = {}
+
-- Character matching.
-- Used for auto-matching parentheses, brackets, braces, and quotes.
local char_matches = {
@@ -58,16 +66,6 @@ local enclosure = {
single_tag = { left = '<', right = ' />' }
}
--- Comment strings for various lexer languages.
--- Used for the block_comment function.
--- @see block_comment
-local comment_strings = {
- cpp = '//~',
- lua = '--~',
- python = '#~',
- ruby = '#~',
-}
-
textadept.events.add_handler('char_added',
function(c) -- matches characters specified in char_matches
if AUTOPAIR and char_matches[c] and buffer.selections == 1 then
@@ -189,7 +187,7 @@ end
function block_comment(comment)
local buffer = buffer
if not comment then
- comment = comment_strings[buffer:get_lexer_language()]
+ comment = comment_string[buffer:get_lexer_language()]
if not comment then return end
end
local caret, anchor = buffer.current_pos, buffer.anchor