diff options
author | 2010-04-10 08:27:25 -0400 | |
---|---|---|
committer | 2010-04-10 08:27:25 -0400 | |
commit | 7f4f30035c8459288666deec9e74f1bc7c41c34f (patch) | |
tree | 18c8ad1f30dfe55015b3a824d91fff749b4a77f0 /modules/cpp/commands.lua | |
parent | f5c492e1f1de148af95accb85e958c3ccdffca5c (diff) | |
download | textadept-7f4f30035c8459288666deec9e74f1bc7c41c34f.tar.gz textadept-7f4f30035c8459288666deec9e74f1bc7c41c34f.zip |
Moved block comment strings to language-specific modules.
Diffstat (limited to 'modules/cpp/commands.lua')
-rw-r--r-- | modules/cpp/commands.lua | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/modules/cpp/commands.lua b/modules/cpp/commands.lua index f01561c4..263b6819 100644 --- a/modules/cpp/commands.lua +++ b/modules/cpp/commands.lua @@ -6,22 +6,24 @@ local textadept = _G.textadept -- Commands for the cpp module. module('_m.cpp.commands', package.seeall) -local run = _m.textadept.run -if run then - run.compile_command.c = 'gcc -pedantic -Os -o "%(filename_noext)" %(filename)' - run.compile_command.cpp = 'g++ -pedantic -Os -o "%(filename_noext)" %(filename)' - run.run_command.c = '%(filedir)%(filename_noext)' - run.run_command.cpp = '%(filedir)%(filename_noext)' - run.error_detail.c = { - pattern = '^(.-):(%d+): (.+)$', - filename = 1, line = 2, message = 3 - } -end +local m_editing, m_run = _m.textadept.editing, _m.textadept.run +-- Comment string tables use lexer names. +m_editing.comment_string.cpp = '//' +-- Compile and Run command tables use file extensions. +m_run.compile_command.c = + 'gcc -pedantic -Os -o "%(filename_noext)" %(filename)' +m_run.compile_command.cpp = + 'g++ -pedantic -Os -o "%(filename_noext)" %(filename)' +m_run.run_command.c = '%(filedir)%(filename_noext)' +m_run.run_command.cpp = '%(filedir)%(filename_noext)' +m_run.error_detail.c = { + pattern = '^(.-):(%d+): (.+)$', + filename = 1, line = 2, message = 3 +} -- C++-specific key commands. local keys = _G.keys if type(keys) == 'table' then - local m_editing = _m.textadept.editing keys.cpp = { al = { m = { textadept.io.open, |