From 7f4f30035c8459288666deec9e74f1bc7c41c34f Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sat, 10 Apr 2010 08:27:25 -0400 Subject: Moved block comment strings to language-specific modules. --- modules/textadept/editing.lua | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'modules/textadept/editing.lua') 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 -- cgit v1.2.3