aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/cpp/init.lua14
-rw-r--r--modules/lua/init.lua8
-rw-r--r--modules/textadept/keys.lua98
-rw-r--r--modules/textadept/menu.lua93
4 files changed, 108 insertions, 105 deletions
diff --git a/modules/cpp/init.lua b/modules/cpp/init.lua
index eaa622a7..0bcf280f 100644
--- a/modules/cpp/init.lua
+++ b/modules/cpp/init.lua
@@ -24,17 +24,17 @@ module('_M.cpp')]]
--
-- * `sense`: The C/C++ [Adeptsense](_M.textadept.adeptsense.html).
-local Mediting, Mrun = _M.textadept.editing, _M.textadept.run
+local m_editing, m_run = _M.textadept.editing, _M.textadept.run
-- Comment string tables use lexer names.
-Mediting.comment_string.cpp = '//'
+m_editing.comment_string.cpp = '//'
-- Compile and Run command tables use file extensions.
-Mrun.compile_command.c =
+m_run.compile_command.c =
'gcc -pedantic -Os -o "%(filename_noext)" %(filename)'
-Mrun.compile_command.cpp =
+m_run.compile_command.cpp =
'g++ -pedantic -Os -o "%(filename_noext)" %(filename)'
-Mrun.run_command.c = '%(filedir)%(filename_noext)'
-Mrun.run_command.cpp = '%(filedir)%(filename_noext)'
-Mrun.error_detail.c = {
+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
}
diff --git a/modules/lua/init.lua b/modules/lua/init.lua
index ce22d8bb..c224ea9d 100644
--- a/modules/lua/init.lua
+++ b/modules/lua/init.lua
@@ -26,12 +26,12 @@ module('_M.lua')]]
--
-- * `sense`: The Lua [Adeptsense](_M.textadept.adeptsense.html).
-local Mediting, Mrun = _M.textadept.editing, _M.textadept.run
+local m_editing, m_run = _M.textadept.editing, _M.textadept.run
-- Comment string tables use lexer names.
-Mediting.comment_string.lua = '--'
+m_editing.comment_string.lua = '--'
-- Compile and Run command tables use file extensions.
-Mrun.run_command.lua = 'lua %(filename)'
-Mrun.error_detail.lua = {
+m_run.run_command.lua = 'lua %(filename)'
+m_run.error_detail.lua = {
pattern = '^lua: (.-):(%d+): (.+)$',
filename = 1, line = 2, message = 3
}
diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua
index aa88ebd3..6dafd4ad 100644
--- a/modules/textadept/keys.lua
+++ b/modules/textadept/keys.lua
@@ -101,8 +101,8 @@ if not RESETTING then constantize_menu_buffer_functions() end
local keys = keys
local io, gui, gui_find, buffer, view = io, gui, gui.find, buffer, view
-local Mtextadept, Mediting = _M.textadept, _M.textadept.editing
-local Mbookmarks, Msnippets = Mtextadept.bookmarks, Mtextadept.snippets
+local m_textadept, m_editing = _M.textadept, _M.textadept.editing
+local m_bookmarks, m_snippets = m_textadept.bookmarks, m_textadept.snippets
local OSX, c = OSX, _SCINTILLA.constants
local utils = M.utils
@@ -147,8 +147,8 @@ keys[not OSX and 'cs' or 'ms'] = buffer.save
keys[not OSX and 'cS' or 'mS'] = buffer.save_as
keys[not OSX and 'cw' or 'mw'] = buffer.close
keys[not OSX and 'cW' or 'mW'] = io.close_all
--- TODO: Mtextadept.sessions.prompt_load
--- TODO: Mtextadept.sessions.prompt_save
+-- TODO: m_textadept.sessions.prompt_load
+-- TODO: m_textadept.sessions.prompt_save
keys[not OSX and 'aq' or 'mq'] = quit
-- Edit.
@@ -161,38 +161,38 @@ keys[not OSX and 'cv' or 'mv'] = buffer.paste
keys[not OSX and 'cd' or 'md'] = buffer.line_duplicate
keys.del = buffer.clear
keys[not OSX and 'ca' or 'ma'] = buffer.select_all
-keys.cm = Mediting.match_brace
-keys[not OSX and 'c\n' or 'cesc'] = { Mediting.autocomplete_word, '%w_' }
+keys.cm = m_editing.match_brace
+keys[not OSX and 'c\n' or 'cesc'] = { m_editing.autocomplete_word, '%w_' }
keys[not OSX and 'adel' or 'cdel'] = utils.delete_word
-keys[not OSX and 'caH' or 'mH'] = Mediting.highlight_word
-keys[not OSX and 'c/' or 'm/'] = Mediting.block_comment
-keys.ct = Mediting.transpose_chars
-keys[not OSX and 'cJ' or 'cj'] = Mediting.join_lines
+keys[not OSX and 'caH' or 'mH'] = m_editing.highlight_word
+keys[not OSX and 'c/' or 'm/'] = m_editing.block_comment
+keys.ct = m_editing.transpose_chars
+keys[not OSX and 'cJ' or 'cj'] = m_editing.join_lines
-- Select.
-keys.cM = { Mediting.match_brace, 'select' }
-keys[not OSX and 'c<' or 'm<'] = { Mediting.select_enclosed, '>', '<' }
-keys[not OSX and 'c>' or 'm>'] = { Mediting.select_enclosed, '<', '>' }
-keys[not OSX and "c'" or "m'"] = { Mediting.select_enclosed, "'", "'" }
-keys[not OSX and 'c"' or 'm"'] = { Mediting.select_enclosed, '"', '"' }
-keys[not OSX and 'c(' or 'm('] = { Mediting.select_enclosed, '(', ')' }
-keys[not OSX and 'c[' or 'm['] = { Mediting.select_enclosed, '[', ']' }
-keys[not OSX and 'c{' or 'm{'] = { Mediting.select_enclosed, '{', '}' }
-keys[not OSX and 'cD' or 'mD'] = Mediting.select_word
-keys[not OSX and 'cN' or 'mN'] = Mediting.select_line
-keys[not OSX and 'cP' or 'mP'] = Mediting.select_paragraph
-keys[not OSX and 'cI' or 'mI'] = Mediting.select_indented_block
+keys.cM = { m_editing.match_brace, 'select' }
+keys[not OSX and 'c<' or 'm<'] = { m_editing.select_enclosed, '>', '<' }
+keys[not OSX and 'c>' or 'm>'] = { m_editing.select_enclosed, '<', '>' }
+keys[not OSX and "c'" or "m'"] = { m_editing.select_enclosed, "'", "'" }
+keys[not OSX and 'c"' or 'm"'] = { m_editing.select_enclosed, '"', '"' }
+keys[not OSX and 'c(' or 'm('] = { m_editing.select_enclosed, '(', ')' }
+keys[not OSX and 'c[' or 'm['] = { m_editing.select_enclosed, '[', ']' }
+keys[not OSX and 'c{' or 'm{'] = { m_editing.select_enclosed, '{', '}' }
+keys[not OSX and 'cD' or 'mD'] = m_editing.select_word
+keys[not OSX and 'cN' or 'mN'] = m_editing.select_line
+keys[not OSX and 'cP' or 'mP'] = m_editing.select_paragraph
+keys[not OSX and 'cI' or 'mI'] = m_editing.select_indented_block
-- Selection.
keys[not OSX and 'cau' or 'cu'] = buffer.upper_case
keys[not OSX and 'caU' or 'cU'] = buffer.lower_case
keys[not OSX and 'a<' or 'c<'] = utils.enclose_as_xml_tags
-keys[not OSX and 'a>' or 'c>'] = { Mediting.enclose, '<', ' />' }
-keys[not OSX and "a'" or "c'"] = { Mediting.enclose, "'", "'" }
-keys[not OSX and 'a"' or 'c"'] = { Mediting.enclose, '"', '"' }
-keys[not OSX and 'a(' or 'c('] = { Mediting.enclose, '(', ')' }
-keys[not OSX and 'a[' or 'c['] = { Mediting.enclose, '[', ']' }
-keys[not OSX and 'a{' or 'c{'] = { Mediting.enclose, '{', '}' }
-keys[not OSX and 'c+' or 'm+'] = { Mediting.grow_selection, 1 }
-keys[not OSX and 'c_' or 'm_'] = { Mediting.grow_selection, -1 }
+keys[not OSX and 'a>' or 'c>'] = { m_editing.enclose, '<', ' />' }
+keys[not OSX and "a'" or "c'"] = { m_editing.enclose, "'", "'" }
+keys[not OSX and 'a"' or 'c"'] = { m_editing.enclose, '"', '"' }
+keys[not OSX and 'a(' or 'c('] = { m_editing.enclose, '(', ')' }
+keys[not OSX and 'a[' or 'c['] = { m_editing.enclose, '[', ']' }
+keys[not OSX and 'a{' or 'c{'] = { m_editing.enclose, '{', '}' }
+keys[not OSX and 'c+' or 'm+'] = { m_editing.grow_selection, 1 }
+keys[not OSX and 'c_' or 'm_'] = { m_editing.grow_selection, -1 }
keys.csup = buffer.move_selected_lines_up
keys.csdown = buffer.move_selected_lines_down
@@ -213,31 +213,31 @@ keys[not OSX and 'cF' or 'mF'] = utils.find_in_files
-- Find in Files is ai when find pane is focused.
keys[not OSX and 'cag' or 'cmg'] = { gui_find.goto_file_in_list, true }
keys[not OSX and 'caG' or 'cmG'] = { gui_find.goto_file_in_list, false }
-keys[not OSX and 'cj' or 'mj'] = Mediting.goto_line
+keys[not OSX and 'cj' or 'mj'] = m_editing.goto_line
-- Tools.
keys[not OSX and 'ce' or 'me'] = gui.command_entry.focus
keys[not OSX and 'cE' or 'mE'] = utils.select_command
-keys[not OSX and 'cr' or 'mr'] = Mtextadept.run.run
-keys[not OSX and 'cR' or 'mR'] = Mtextadept.run.compile
-keys[not OSX and 'c|' or 'm|'] = Mtextadept.filter_through.filter_through
+keys[not OSX and 'cr' or 'mr'] = m_textadept.run.run
+keys[not OSX and 'cR' or 'mR'] = m_textadept.run.compile
+keys[not OSX and 'c|' or 'm|'] = m_textadept.filter_through.filter_through
-- Adeptsense.
-keys[not OSX and 'c ' or 'aesc'] = Mtextadept.adeptsense.complete_symbol
-keys.ch = Mtextadept.adeptsense.show_documentation
+keys[not OSX and 'c ' or 'aesc'] = m_textadept.adeptsense.complete_symbol
+keys.ch = m_textadept.adeptsense.show_documentation
-- Snippets.
-keys[not OSX and 'ck' or 'a\t'] = Msnippets._select
-keys['\t'] = Msnippets._insert
-keys['s\t'] = Msnippets._previous
-keys[not OSX and 'cK' or 'as\t'] = Msnippets._cancel_current
+keys[not OSX and 'ck' or 'a\t'] = m_snippets._select
+keys['\t'] = m_snippets._insert
+keys['s\t'] = m_snippets._previous
+keys[not OSX and 'cK' or 'as\t'] = m_snippets._cancel_current
-- Bookmark.
-keys[not OSX and 'cf2' or 'mf2'] = Mbookmarks.toggle
-keys[not OSX and 'csf2' or 'msf2'] = Mbookmarks.clear
-keys.f2 = Mbookmarks.goto_next
-keys.sf2 = Mbookmarks.goto_prev
-keys.af2 = Mbookmarks.goto_bookmark
+keys[not OSX and 'cf2' or 'mf2'] = m_bookmarks.toggle
+keys[not OSX and 'csf2' or 'msf2'] = m_bookmarks.clear
+keys.f2 = m_bookmarks.goto_next
+keys.sf2 = m_bookmarks.goto_prev
+keys.af2 = m_bookmarks.goto_bookmark
-- Snapopen.
-keys[not OSX and 'cu' or 'mu'] = { Mtextadept.snapopen.open, _USERHOME }
--- TODO: { Mtextadept.snapopen.open, _HOME }
+keys[not OSX and 'cu' or 'mu'] = { m_textadept.snapopen.open, _USERHOME }
+-- TODO: { m_textadept.snapopen.open, _HOME }
keys[not OSX and 'caO' or 'cmO'] = utils.snapopen_filedir
keys[not OSX and 'ci' or 'mi'] = utils.show_style
@@ -251,7 +251,7 @@ keys[not OSX and 'cb' or 'mb'] = gui.switch_buffer
-- TODO: { utils.set_indentation, 4 }
-- TODO: { utils.set_indentation, 8 }
keys[not OSX and 'caT' or 'cT'] = { utils.toggle_property, 'use_tabs' }
-keys[not OSX and 'cai' or 'ci'] = Mediting.convert_indentation
+keys[not OSX and 'cai' 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 }
@@ -262,7 +262,7 @@ keys[not OSX and 'cai' or 'ci'] = Mediting.convert_indentation
-- TODO: { utils.set_encoding, 'ISO-8859-1' }
-- TODO: { utils.set_encoding, 'MacRoman' }
-- TODO: { utils.set_encoding, 'UTF-16LE' }
-keys[not OSX and 'cL' or 'mL'] = Mtextadept.mime_types.select_lexer
+keys[not OSX and 'cL' or 'mL'] = m_textadept.mime_types.select_lexer
keys.f5 = { buffer.colourise, buffer, 0, -1 }
-- View.
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua
index e32af6cc..cb59d663 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -24,9 +24,9 @@ local function get_id(f)
end
local _L, io, gui, gui_find, buffer, view = _L, io, gui, gui.find, buffer, view
-local Mtextadept, Mediting = _M.textadept, _M.textadept.editing
-local Mbookmarks, Msnippets = Mtextadept.bookmarks, Mtextadept.snippets
-local utils = Mtextadept.keys.utils
+local m_textadept, m_editing = _M.textadept, _M.textadept.editing
+local m_bookmarks, Msnippets = m_textadept.bookmarks, m_textadept.snippets
+local utils = m_textadept.keys.utils
local SEPARATOR, c = { 'separator' }, _SCINTILLA.constants
---
@@ -45,8 +45,8 @@ M.menubar = {
{ _L['gtk-close'], buffer.close },
{ _L['Close All'], io.close_all },
SEPARATOR,
- { _L['Load Session...'], Mtextadept.session.prompt_load },
- { _L['Save Session...'], Mtextadept.session.prompt_save },
+ { _L['Load Session...'], m_textadept.session.prompt_load },
+ { _L['Save Session...'], m_textadept.session.prompt_save },
SEPARATOR,
{ _L['gtk-quit'], quit },
},
@@ -62,40 +62,43 @@ M.menubar = {
{ _L['Delete Word'], utils.delete_word },
{ _L['gtk-select-all'], buffer.select_all },
SEPARATOR,
- { _L['Match Brace'], Mediting.match_brace },
- { _L['Complete Word'], { Mediting.autocomplete_word, '%w_' } },
- { _L['Highlight Word'], Mediting.highlight_word },
- { _L['Toggle Block Comment'], Mediting.block_comment },
- { _L['Transpose Characters'], Mediting.transpose_chars },
- { _L['Join Lines'], Mediting.join_lines },
+ { _L['Match Brace'], m_editing.match_brace },
+ { _L['Complete Word'], { m_editing.autocomplete_word, '%w_' } },
+ { _L['Highlight Word'], m_editing.highlight_word },
+ { _L['Toggle Block Comment'], m_editing.block_comment },
+ { _L['Transpose Characters'], m_editing.transpose_chars },
+ { _L['Join Lines'], m_editing.join_lines },
{ title = _L['Select'],
- { _L['Select to Matching Brace'], { Mediting.match_brace, 'select' } },
- { _L['Select between XML Tags'], { Mediting.select_enclosed, '>', '<' } },
- { _L['Select in XML Tag'], { Mediting.select_enclosed, '<', '>' } },
- { _L['Select in Single Quotes'], { Mediting.select_enclosed, "'", "'" } },
- { _L['Select in Double Quotes'], { Mediting.select_enclosed, '"', '"' } },
- { _L['Select in Parentheses'], { Mediting.select_enclosed, '(', ')' } },
- { _L['Select in Brackets'], { Mediting.select_enclosed, '[', ']' } },
- { _L['Select in Braces'], { Mediting.select_enclosed, '{', '}' } },
- { _L['Select Word'], Mediting.select_word },
- { _L['Select Line'], Mediting.select_line },
- { _L['Select Paragraph'], Mediting.select_paragraph },
- { _L['Select Indented Block'], Mediting.select_indented_block },
+ { _L['Select to Matching Brace'], { m_editing.match_brace, 'select' } },
+ { _L['Select between XML Tags'],
+ { m_editing.select_enclosed, '>', '<' } },
+ { _L['Select in XML Tag'], { m_editing.select_enclosed, '<', '>' } },
+ { _L['Select in Single Quotes'],
+ { m_editing.select_enclosed, "'", "'" } },
+ { _L['Select in Double Quotes'],
+ { m_editing.select_enclosed, '"', '"' } },
+ { _L['Select in Parentheses'], { m_editing.select_enclosed, '(', ')' } },
+ { _L['Select in Brackets'], { m_editing.select_enclosed, '[', ']' } },
+ { _L['Select in Braces'], { m_editing.select_enclosed, '{', '}' } },
+ { _L['Select Word'], m_editing.select_word },
+ { _L['Select Line'], m_editing.select_line },
+ { _L['Select Paragraph'], m_editing.select_paragraph },
+ { _L['Select Indented Block'], m_editing.select_indented_block },
},
{ title = _L['Selection'],
{ _L['Upper Case Selection'], buffer.upper_case },
{ _L['Lower Case Selection'], buffer.lower_case },
SEPARATOR,
{ _L['Enclose as XML Tags'], utils.enclose_as_xml_tags },
- { _L['Enclose as Single XML Tag'], { Mediting.enclose, '<', ' />' } },
- { _L['Enclose in Single Quotes'], { Mediting.enclose, "'", "'" } },
- { _L['Enclose in Double Quotes'], { Mediting.enclose, '"', '"' } },
- { _L['Enclose in Parentheses'], { Mediting.enclose, '(', ')' } },
- { _L['Enclose in Brackets'], { Mediting.enclose, '[', ']' } },
- { _L['Enclose in Braces'], { Mediting.enclose, '{', '}' } },
+ { _L['Enclose as Single XML Tag'], { m_editing.enclose, '<', ' />' } },
+ { _L['Enclose in Single Quotes'], { m_editing.enclose, "'", "'" } },
+ { _L['Enclose in Double Quotes'], { m_editing.enclose, '"', '"' } },
+ { _L['Enclose in Parentheses'], { m_editing.enclose, '(', ')' } },
+ { _L['Enclose in Brackets'], { m_editing.enclose, '[', ']' } },
+ { _L['Enclose in Braces'], { m_editing.enclose, '{', '}' } },
SEPARATOR,
- { _L['Grow Selection'], { Mediting.grow_selection, 1 } },
- { _L['Shrink Selection'], { Mediting.grow_selection, -1 } },
+ { _L['Grow Selection'], { m_editing.grow_selection, 1 } },
+ { _L['Shrink Selection'], { m_editing.grow_selection, -1 } },
SEPARATOR,
{ _L['Move Selected Lines Up'], buffer.move_selected_lines_up },
{ _L['Move Selected Lines Down'], buffer.move_selected_lines_down },
@@ -113,30 +116,30 @@ M.menubar = {
{ _L['Goto Next File Found'], { gui_find.goto_file_in_list, true } },
{ _L['Goto Previous File Found'], { gui_find.goto_file_in_list, false } },
SEPARATOR,
- { _L['gtk-jump-to'], Mediting.goto_line },
+ { _L['gtk-jump-to'], m_editing.goto_line },
},
{ title = _L['Tools'],
{ _L['Command Entry'], gui.command_entry.focus },
{ _L['Select Command'], utils.select_command },
SEPARATOR,
- { _L['Run'], Mtextadept.run.run },
- { _L['Compile'], Mtextadept.run.compile },
+ { _L['Run'], m_textadept.run.run },
+ { _L['Compile'], m_textadept.run.compile },
{ _L['Filter Through'], _M.textadept.filter_through.filter_through },
SEPARATOR,
{ title = _L['Adeptsense'],
- { _L['Complete Symbol'], Mtextadept.adeptsense.complete_symbol },
- { _L['Show Documentation'], Mtextadept.adeptsense.show_documentation },
+ { _L['Complete Symbol'], m_textadept.adeptsense.complete_symbol },
+ { _L['Show Documentation'], m_textadept.adeptsense.show_documentation },
},
{ title = _L['Bookmark'],
- { _L['Toggle Bookmark'], Mbookmarks.toggle },
- { _L['Clear Bookmarks'], Mbookmarks.clear },
- { _L['Next Bookmark'], Mbookmarks.goto_next },
- { _L['Previous Bookmark'], Mbookmarks.goto_prev },
- { _L['Goto Bookmark...'], Mbookmarks.goto_bookmark },
+ { _L['Toggle Bookmark'], m_bookmarks.toggle },
+ { _L['Clear Bookmarks'], m_bookmarks.clear },
+ { _L['Next Bookmark'], m_bookmarks.goto_next },
+ { _L['Previous Bookmark'], m_bookmarks.goto_prev },
+ { _L['Goto Bookmark...'], m_bookmarks.goto_bookmark },
},
{ title = _L['Snapopen'],
- { _L['Snapopen User Home'], { Mtextadept.snapopen.open, _USERHOME } },
- { _L['Snapopen Textadept Home'], { Mtextadept.snapopen.open, _HOME } },
+ { _L['Snapopen User Home'], { m_textadept.snapopen.open, _USERHOME } },
+ { _L['Snapopen Textadept Home'], { m_textadept.snapopen.open, _HOME } },
{ _L['Snapopen Current Directory'], utils.snapopen_filedir },
},
{ title = _L['Snippets'],
@@ -160,7 +163,7 @@ M.menubar = {
{ _L['Tab width: 8'], { utils.set_indentation, 8 } },
SEPARATOR,
{ _L['Toggle Use Tabs'], { utils.toggle_property, 'use_tabs' } },
- { _L['Convert Indentation'], Mediting.convert_indentation },
+ { _L['Convert Indentation'], m_editing.convert_indentation },
},
{ title = _L['EOL Mode'],
{ _L['CRLF'], { utils.set_eol_mode, c.SC_EOL_CRLF } },
@@ -175,7 +178,7 @@ M.menubar = {
{ _L['UTF-16 Encoding'], { utils.set_encoding, 'UTF-16LE' } },
},
SEPARATOR,
- { _L['Select Lexer...'], Mtextadept.mime_types.select_lexer },
+ { _L['Select Lexer...'], m_textadept.mime_types.select_lexer },
{ _L['Refresh Syntax Highlighting'],
{ buffer.colourise, buffer, 0, -1 } },
},