aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2012-01-05 05:20:39 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2012-01-05 05:20:39 -0500
commit2ab6deaecb4576c932dd63186927e9481bf5dedc (patch)
tree2574adf1f9c7a789456c1e467c0d98a17a4609b6 /modules/textadept
parent6143b96a6d71a0d8d04ed7d4ddc3696a141112c7 (diff)
downloadtextadept-2ab6deaecb4576c932dd63186927e9481bf5dedc.tar.gz
textadept-2ab6deaecb4576c932dd63186927e9481bf5dedc.zip
Rename '_m' to '_M'.
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/adeptsense.lua18
-rw-r--r--modules/textadept/bookmarks.lua8
-rw-r--r--modules/textadept/editing.lua6
-rw-r--r--modules/textadept/filter_through.lua2
-rw-r--r--modules/textadept/find.lua2
-rw-r--r--modules/textadept/init.lua4
-rw-r--r--modules/textadept/keys.lua110
-rw-r--r--modules/textadept/menu.lua111
-rw-r--r--modules/textadept/mime_types.lua6
-rw-r--r--modules/textadept/run.lua4
-rw-r--r--modules/textadept/session.lua6
-rw-r--r--modules/textadept/snapopen.lua12
-rw-r--r--modules/textadept/snippets.lua2
13 files changed, 144 insertions, 147 deletions
diff --git a/modules/textadept/adeptsense.lua b/modules/textadept/adeptsense.lua
index 281937fe..14a570d3 100644
--- a/modules/textadept/adeptsense.lua
+++ b/modules/textadept/adeptsense.lua
@@ -5,7 +5,7 @@ local M = {}
--[[ This comment is for LuaDoc.
---
-- Language autocompletion support for the textadept module.
-module('_m.textadept.adeptsense')]]
+module('_M.textadept.adeptsense')]]
-- Markdown:
-- ## Overview
@@ -50,7 +50,7 @@ module('_m.textadept.adeptsense')]]
-- $> cd modules/lua/
-- $> textadept init.lua
--
--- sense = _m.textadept.adeptsense.new('lua')
+-- sense = _M.textadept.adeptsense.new('lua')
--
-- Where 'lua' is replaced by your language's name.
--
@@ -102,12 +102,12 @@ module('_m.textadept.adeptsense')]]
--
-- Sometimes a type can be inferred by the right side of a variable assignment.
-- In the Lua code `local foo = 'bar'`, the variable `foo` has type `string`.
--- Similarly, in `local foo = _m.textadept.adeptsense`, `foo` has type
--- `_m.textadept.adeptsense`.
+-- Similarly, in `local foo = _M.textadept.adeptsense`, `foo` has type
+-- `_M.textadept.adeptsense`.
--
-- sense.syntax.type_assignments = {
-- ['^[\'"]'] = 'string', -- foo = 'bar' or foo = "bar"
--- ['^([%w_%.]+)'] = '%1' -- foo = _m.textadept.adeptsense
+-- ['^([%w_%.]+)'] = '%1' -- foo = _M.textadept.adeptsense
-- }
--
-- Note the `^` in the pattern. The beginning of the right hand side of the
@@ -753,7 +753,7 @@ function M.goto_ctag(sense, k, title)
buffer:goto_pos(buffer.target_start)
end
else
- _m.textadept.editing.goto_line(tonumber(line))
+ _M.textadept.editing.goto_line(tonumber(line))
end
end
@@ -796,7 +796,7 @@ function M.handle_clear(sense) end
-- Only one sense can exist per language.
-- @param lang The lexer language to create an Adeptsense for.
-- @return adeptsense
--- @usage local lua_sense = _m.textadept.adeptsense.new('lua')
+-- @usage local lua_sense = _M.textadept.adeptsense.new('lua')
-- @name new
function M.new(lang)
local sense = senses[lang]
@@ -921,7 +921,7 @@ end
-- This should be called by key commands and menus instead of `complete()`.
-- @name complete_symbol
function M.complete_symbol()
- local m = _m[buffer:get_lexer()]
+ local m = _M[buffer:get_lexer()]
if m and m.sense then m.sense:complete() end
end
@@ -931,7 +931,7 @@ end
-- This should be called by key commands and menus instead of `show_apidoc()`.
-- @name show_documentation
function M.show_documentation()
- local m = _m[buffer:get_lexer()]
+ local m = _M[buffer:get_lexer()]
if m and m.sense then m.sense:show_apidoc() end
end
diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua
index 31ae08bb..0173bdcf 100644
--- a/modules/textadept/bookmarks.lua
+++ b/modules/textadept/bookmarks.lua
@@ -5,7 +5,7 @@ local M = {}
--[[ This comment is for LuaDoc.
---
-- Bookmarks for the textadept module.
-module('_m.textadept.bookmarks')]]
+module('_M.textadept.bookmarks')]]
-- Markdown:
-- ## Settings
@@ -61,7 +61,7 @@ function M.goto_next()
local current_line = buffer:line_from_position(buffer.current_pos)
local line = buffer:marker_next(current_line + 1, 2^MARK_BOOKMARK)
if line == -1 then line = buffer:marker_next(0, 2^MARK_BOOKMARK) end
- if line >= 0 then _m.textadept.editing.goto_line(line + 1) end
+ if line >= 0 then _M.textadept.editing.goto_line(line + 1) end
end
---
@@ -74,7 +74,7 @@ function M.goto_prev()
if line == -1 then
line = buffer:marker_previous(buffer.line_count, 2^MARK_BOOKMARK)
end
- if line >= 0 then _m.textadept.editing.goto_line(line + 1) end
+ if line >= 0 then _M.textadept.editing.goto_line(line + 1) end
end
---
@@ -90,7 +90,7 @@ function M.goto_bookmark()
line = buffer:marker_next(line + 1, 2^MARK_BOOKMARK)
until line < 0
local line = gui.filteredlist(_L['Select Bookmark'], _L['Bookmark'], markers)
- if line then _m.textadept.editing.goto_line(line:match('^%d+')) end
+ if line then _M.textadept.editing.goto_line(line:match('^%d+')) end
end
if buffer then buffer:marker_set_back(MARK_BOOKMARK, M.MARK_BOOKMARK_COLOR) end
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 7111870b..f960f7b9 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -5,7 +5,7 @@ local M = {}
--[[ This comment is for LuaDoc.
---
-- Editing commands for the textadept module.
-module('_m.textadept.editing')]]
+module('_M.textadept.editing')]]
-- Markdown:
-- ## Settings
@@ -52,7 +52,7 @@ M.comment_string = {}
-- '[]', '{}', '''', and '""'.
-- @class table
-- @name char_matches
--- @usage _m.textadept.editing.char_matches.hypertext = { ..., [60] = '>' }
+-- @usage _M.textadept.editing.char_matches.hypertext = { ..., [60] = '>' }
M.char_matches = { [40] = ')', [91] = ']', [123] = '}', [39] = "'", [34] = '"' }
---
@@ -62,7 +62,7 @@ M.char_matches = { [40] = ')', [91] = ']', [123] = '}', [39] = "'", [34] = '"' }
-- modules. The defaults are '(', ')', '[', ']', '{', and '}'.
-- @class table
-- @name braces
--- @usage _m.textadept.editing.braces.hypertext = { ..., [60] = 1, [62] = 1 }
+-- @usage _M.textadept.editing.braces.hypertext = { ..., [60] = 1, [62] = 1 }
M.braces = { [40] = 1, [41] = 1, [91] = 1, [93] = 1, [123] = 1, [125] = 1 }
-- The current call tip.
diff --git a/modules/textadept/filter_through.lua b/modules/textadept/filter_through.lua
index 5a981270..b89a926f 100644
--- a/modules/textadept/filter_through.lua
+++ b/modules/textadept/filter_through.lua
@@ -5,7 +5,7 @@ local M = {}
--[[ This comment is for LuaDoc.
---
-- Filter-Through for the textadept module.
-module('_m.textadept.filter_through')]]
+module('_M.textadept.filter_through')]]
local cat = not WIN32 and 'cat' or 'type'
local tmpfile = _USERHOME..'/.ft'
diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua
index 269c2f9b..f07bdade 100644
--- a/modules/textadept/find.lua
+++ b/modules/textadept/find.lua
@@ -352,7 +352,7 @@ local function goto_file(pos, line_num)
buffer:marker_add(line_num, MARK_FIND)
buffer:goto_pos(buffer.current_pos)
gui.goto_file(file, true, preferred_view)
- _m.textadept.editing.goto_line(file_line_num)
+ _M.textadept.editing.goto_line(file_line_num)
end
end
end
diff --git a/modules/textadept/init.lua b/modules/textadept/init.lua
index c8c022b0..e21bf5bf 100644
--- a/modules/textadept/init.lua
+++ b/modules/textadept/init.lua
@@ -1,13 +1,13 @@
-- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local M = {}
-_m.textadept = M
+_M.textadept = M
--[[ This comment is for LuaDoc.
---
-- The textadept module.
-- It provides utilities for editing text in Textadept.
-module('_m.textadept')]]
+module('_M.textadept')]]
M.adeptsense = require 'textadept.adeptsense'
M.bookmarks = require 'textadept.bookmarks'
diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua
index 1c2f8aaf..40954110 100644
--- a/modules/textadept/keys.lua
+++ b/modules/textadept/keys.lua
@@ -6,13 +6,13 @@ local M = {}
---
-- Defines key commands for Textadept.
-- This set of key commands is pretty standard among other text editors.
--- This module, should be 'require'ed last, but before _m.textadept.menu.
-module('_m.textadept.keys')]]
+-- This module, should be 'require'ed last, but before _M.textadept.menu.
+module('_M.textadept.keys')]]
-- Utility functions.
M.utils = {
enclose_as_xml_tags = function()
- _m.textadept.editing.enclose('<', '>')
+ _M.textadept.editing.enclose('<', '>')
local buffer = buffer
local pos = buffer.current_pos
while buffer.char_at[pos - 1] ~= 60 do pos = pos - 1 end -- '<'
@@ -22,10 +22,10 @@ M.utils = {
gui.find.in_files = true
gui.find.focus()
end,
- select_command = function() _m.textadept.menu.select_command() end,
+ select_command = function() _M.textadept.menu.select_command() end,
snapopen_filedir = function()
if buffer.filename then
- _m.textadept.snapopen.open(buffer.filename:match('^(.+)[/\\]'))
+ _M.textadept.snapopen.open(buffer.filename:match('^(.+)[/\\]'))
end
end,
show_style = function()
@@ -97,8 +97,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 m_textadept, m_editing = _m.textadept, _m.textadept.editing
-local m_bookmarks, m_snippets = m_textadept.bookmarks, m_textadept.snippets
+local Mtextadept, Mediting = _M.textadept, _M.textadept.editing
+local Mbookmarks, Msnippets = Mtextadept.bookmarks, Mtextadept.snippets
local OSX, c = OSX, _SCINTILLA.constants
local utils = M.utils
@@ -143,8 +143,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: m_textadept.sessions.prompt_load
--- TODO: m_textadept.sessions.prompt_save
+-- TODO: Mtextadept.sessions.prompt_load
+-- TODO: Mtextadept.sessions.prompt_save
keys[not OSX and 'aq' or 'mq'] = quit
-- Edit.
@@ -157,38 +157,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 = m_editing.match_brace
-keys[not OSX and 'c\n' or 'cesc'] = { m_editing.autocomplete_word, '%w_' }
-keys[not OSX and 'adel' or 'cdel'] = { m_editing.current_word, 'delete' }
-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
+keys.cm = Mediting.match_brace
+keys[not OSX and 'c\n' or 'cesc'] = { Mediting.autocomplete_word, '%w_' }
+keys[not OSX and 'adel' or 'cdel'] = { Mediting.current_word, 'delete' }
+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
-- Select.
-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.current_word, 'select' }
-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
+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.current_word, 'select' }
+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
-- 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>'] = { 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[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.csup = buffer.move_selected_lines_up
keys.csdown = buffer.move_selected_lines_down
@@ -209,31 +209,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'] = m_editing.goto_line
+keys[not OSX and 'cj' or 'mj'] = Mediting.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'] = 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
+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
-- Adeptsense.
-keys[not OSX and 'c ' or 'aesc'] = m_textadept.adeptsense.complete_symbol
-keys.ch = m_textadept.adeptsense.show_documentation
+keys[not OSX and 'c ' or 'aesc'] = Mtextadept.adeptsense.complete_symbol
+keys.ch = Mtextadept.adeptsense.show_documentation
-- Snippets.
-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
+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
-- 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
+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
-- Snapopen.
-keys[not OSX and 'cu' or 'mu'] = { m_textadept.snapopen.open, _USERHOME }
--- TODO: { m_textadept.snapopen.open, _HOME }
+keys[not OSX and 'cu' or 'mu'] = { Mtextadept.snapopen.open, _USERHOME }
+-- TODO: { Mtextadept.snapopen.open, _HOME }
keys[not OSX and 'caO' or 'cmO'] = utils.snapopen_filedir
keys[not OSX and 'ci' or 'mi'] = utils.show_style
@@ -247,7 +247,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'] = m_editing.convert_indentation
+keys[not OSX and 'cai' or 'ci'] = Mediting.convert_indentation
-- EOL Mode.
-- TODO: { utils.set_eol_mode, c.SC_EOL_CRLF }
-- TODO: { utils.set_eol_mode, c.SC_EOL_CR }
@@ -258,7 +258,7 @@ keys[not OSX and 'cai' or 'ci'] = m_editing.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'] = m_textadept.mime_types.select_lexer
+keys[not OSX and 'cL' or 'mL'] = Mtextadept.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 a07c29e2..ba8f7f89 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -6,9 +6,9 @@ local M = {}
--[[ This comment is for LuaDoc.
---
-- Provides dynamic menus for Textadept.
--- This module should be `require`ed last, after `_m.textadept.keys` since it
+-- This module should be `require`ed last, after `_M.textadept.keys` since it
-- looks up defined key commands to show them in menus.
-module('_m.textadept.menu')]]
+module('_M.textadept.menu')]]
-- Get a string uniquely identifying a key command.
-- This is used to match menu items with key commands to show the key shortcut.
@@ -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 m_textadept, m_editing = _m.textadept, _m.textadept.editing
-local m_bookmarks, m_snippets = m_textadept.bookmarks, m_textadept.snippets
-local utils = m_textadept.keys.utils
+local Mtextadept, Mediting = _M.textadept, _M.textadept.editing
+local Mbookmarks, Msnippets = Mtextadept.bookmarks, Mtextadept.snippets
+local utils = Mtextadept.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...'], m_textadept.session.prompt_load },
- { _L['Save Session...'], m_textadept.session.prompt_save },
+ { _L['Load Session...'], Mtextadept.session.prompt_load },
+ { _L['Save Session...'], Mtextadept.session.prompt_save },
SEPARATOR,
{ _L['gtk-quit'], quit },
},
@@ -61,44 +61,41 @@ M.menubar = {
{ _L['gtk-delete'], buffer.clear },
{ _L['gtk-select-all'], buffer.select_all },
SEPARATOR,
- { _L['Match Brace'], m_editing.match_brace },
- { _L['Complete Word'], { m_editing.autocomplete_word, '%w_' } },
- { _L['Delete Word'], { m_editing.current_word, 'delete' } },
- { _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 },
+ { _L['Match Brace'], Mediting.match_brace },
+ { _L['Complete Word'], { Mediting.autocomplete_word, '%w_' } },
+ { _L['Delete Word'], { Mediting.current_word, 'delete' } },
+ { _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 },
{ title = _L['Select'],
- { _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.current_word, 'select' } },
- { _L['Select Line'], m_editing.select_line },
- { _L['Select Paragraph'], m_editing.select_paragraph },
- { _L['Select Indented Block'], m_editing.select_indented_block },
+ { _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.current_word, 'select' } },
+ { _L['Select Line'], Mediting.select_line },
+ { _L['Select Paragraph'], Mediting.select_paragraph },
+ { _L['Select Indented Block'], Mediting.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'], { 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, '{', '}' } },
+ { _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, '{', '}' } },
SEPARATOR,
- { _L['Grow Selection'], { m_editing.grow_selection, 1 } },
- { _L['Shrink Selection'], { m_editing.grow_selection, -1 } },
+ { _L['Grow Selection'], { Mediting.grow_selection, 1 } },
+ { _L['Shrink Selection'], { Mediting.grow_selection, -1 } },
SEPARATOR,
{ _L['Move Selected Lines Up'], buffer.move_selected_lines_up },
{ _L['Move Selected Lines Down'], buffer.move_selected_lines_down },
@@ -116,37 +113,37 @@ 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'], m_editing.goto_line },
+ { _L['gtk-jump-to'], Mediting.goto_line },
},
{ title = _L['Tools'],
{ _L['Command Entry'], gui.command_entry.focus },
{ _L['Select Command'], utils.select_command },
SEPARATOR,
- { _L['Run'], m_textadept.run.run },
- { _L['Compile'], m_textadept.run.compile },
- { _L['Filter Through'], _m.textadept.filter_through.filter_through },
+ { _L['Run'], Mtextadept.run.run },
+ { _L['Compile'], Mtextadept.run.compile },
+ { _L['Filter Through'], _M.textadept.filter_through.filter_through },
SEPARATOR,
{ title = _L['Adeptsense'],
- { _L['Complete Symbol'], m_textadept.adeptsense.complete_symbol },
- { _L['Show Documentation'], m_textadept.adeptsense.show_documentation },
+ { _L['Complete Symbol'], Mtextadept.adeptsense.complete_symbol },
+ { _L['Show Documentation'], Mtextadept.adeptsense.show_documentation },
},
{ title = _L['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 },
+ { _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 },
},
{ title = _L['Snapopen'],
- { _L['Snapopen User Home'], { m_textadept.snapopen.open, _USERHOME } },
- { _L['Snapopen Textadept Home'], { m_textadept.snapopen.open, _HOME } },
+ { _L['Snapopen User Home'], { Mtextadept.snapopen.open, _USERHOME } },
+ { _L['Snapopen Textadept Home'], { Mtextadept.snapopen.open, _HOME } },
{ _L['Snapopen Current Directory'], utils.snapopen_filedir },
},
{ title = _L['Snippets'],
- { _L['Insert Snippet...'], m_snippets._select },
- { _L['Expand Snippet/Next Placeholder'], m_snippets._insert },
- { _L['Previous Snippet Placeholder'], m_snippets._previous },
- { _L['Cancel Snippet'], m_snippets._cancel_current },
+ { _L['Insert Snippet...'], Msnippets._select },
+ { _L['Expand Snippet/Next Placeholder'], Msnippets._insert },
+ { _L['Previous Snippet Placeholder'], Msnippets._previous },
+ { _L['Cancel Snippet'], Msnippets._cancel_current },
},
SEPARATOR,
{ _L['Show Style'], utils.show_style },
@@ -163,7 +160,7 @@ M.menubar = {
{ _L['Tab width: 8'], { utils.set_indentation, 8 } },
SEPARATOR,
{ _L['Toggle Use Tabs'], { utils.toggle_property, 'use_tabs' } },
- { _L['Convert Indentation'], m_editing.convert_indentation },
+ { _L['Convert Indentation'], Mediting.convert_indentation },
},
{ title = _L['EOL Mode'],
{ _L['CRLF'], { utils.set_eol_mode, c.SC_EOL_CRLF } },
@@ -178,7 +175,7 @@ M.menubar = {
{ _L['UTF-16 Encoding'], { utils.set_encoding, 'UTF-16LE' } },
},
SEPARATOR,
- { _L['Select Lexer...'], m_textadept.mime_types.select_lexer },
+ { _L['Select Lexer...'], Mtextadept.mime_types.select_lexer },
{ _L['Refresh Syntax Highlighting'],
{ buffer.colourise, buffer, 0, -1 } },
},
@@ -358,7 +355,7 @@ end)
-- Set a language-specific context menu or the default one.
local function set_language_contextmenu()
local lang = _G.buffer:get_lexer()
- M.set_contextmenu(_m[lang] and _m[lang].context_menu or M.context_menu)
+ M.set_contextmenu(_M[lang] and _M[lang].context_menu or M.context_menu)
end
events_connect(events.LANGUAGE_MODULE_LOADED, set_language_contextmenu)
events_connect(events.BUFFER_AFTER_SWITCH, set_language_contextmenu)
diff --git a/modules/textadept/mime_types.lua b/modules/textadept/mime_types.lua
index df0ea957..b3e05317 100644
--- a/modules/textadept/mime_types.lua
+++ b/modules/textadept/mime_types.lua
@@ -5,7 +5,7 @@ local M = {}
--[[ This comment is for LuaDoc.
---
-- Handles file-specific settings.
-module('_m.textadept.mime_types')]]
+module('_M.textadept.mime_types')]]
-- Markdown:
-- ## Overview
@@ -132,10 +132,10 @@ local function set_lexer(buffer, lang)
buffer:private_lexer_call(SETDIRECTPOINTER, buffer.direct_pointer)
buffer:private_lexer_call(SETLEXERLANGUAGE, lang)
if package.searchpath(lang, package.path) then
- _m[lang] = require(lang)
+ _M[lang] = require(lang)
local post_init = lang..'.post_init'
if package.searchpath(post_init, package.path) then require(post_init) end
- _m[lang].set_buffer_properties()
+ _M[lang].set_buffer_properties()
events.emit(events.LANGUAGE_MODULE_LOADED, lang)
end
buffer:colourise(0, -1)
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index 5ef8a3f8..e62e11d0 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -8,7 +8,7 @@ local M = {}
-- Typically, language-specific modules populate the 'compile_command',
-- 'run_command', and 'error_detail' tables for a particular language's file
-- extension.
-module('_m.textadept.run')]]
+module('_M.textadept.run')]]
-- Markdown:
-- ## Run Events
@@ -150,7 +150,7 @@ function goto_error(pos, line_num)
local filename = utf8_filename:iconv(_CHARSET, 'UTF-8')
if lfs.attributes(filename) then
gui.goto_file(utf8_filename, true)
- _m.textadept.editing.goto_line(captures[error_detail.line])
+ _M.textadept.editing.goto_line(captures[error_detail.line])
local msg = captures[error_detail.message]
if msg then buffer:call_tip_show(buffer.current_pos, msg) end
else
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua
index 99ac0c46..4e007674 100644
--- a/modules/textadept/session.lua
+++ b/modules/textadept/session.lua
@@ -5,7 +5,7 @@ local M = {}
--[[ This comment is for LuaDoc.
---
-- Session support for the textadept module.
-module('_m.textadept.session')]]
+module('_M.textadept.session')]]
-- Markdown:
-- ## Settings
@@ -28,7 +28,7 @@ M.MAX_RECENT_FILES = 10
-- @param filename The absolute path to the session file to load. Defaults to
-- `DEFAULT_SESSION` if not specified.
-- @return `true` if the session file was opened and read; `false` otherwise.
--- @usage _m.textadept.session.load(filename)
+-- @usage _M.textadept.session.load(filename)
-- @name load
function M.load(filename)
local not_found = {}
@@ -104,7 +104,7 @@ events.connect('arg_none', function() if M.SAVE_ON_QUIT then M.load() end end)
-- details.
-- @param filename The absolute path to the session file to save. Defaults to
-- either the current session file or `DEFAULT_SESSION` if not specified.
--- @usage _m.textadept.session.save(filename)
+-- @usage _M.textadept.session.save(filename)
-- @name save
function M.save(filename)
local session = {}
diff --git a/modules/textadept/snapopen.lua b/modules/textadept/snapopen.lua
index 02d20f2a..4bc72d64 100644
--- a/modules/textadept/snapopen.lua
+++ b/modules/textadept/snapopen.lua
@@ -5,7 +5,7 @@ local M = {}
--[[ This comment is for LuaDoc.
---
-- Snapopen for the textadept module.
-module('_m.textadept.snapopen')]]
+module('_M.textadept.snapopen')]]
-- Markdown:
-- ## Settings
@@ -18,7 +18,7 @@ module('_m.textadept.snapopen')]]
--
-- ## Examples
--
--- local snapopen = _m.textadept.snapopen.open
+-- local snapopen = _M.textadept.snapopen.open
--
-- -- Show all files in PATHS.
-- snapopen()
@@ -96,10 +96,10 @@ end
-- search. Defaults to `false`.
-- @param depth Number of directories to recurse into for finding files.
-- Defaults to `DEFAULT_DEPTH`.
--- @usage _m.textadept.snapopen.open()
--- @usage _m.textadept.snapopen.open(buffer.filename:match('^.+/'), nil, true)
--- @usage _m.textadept.snapopen.open(nil, '!%.lua$')
--- @usage _m.textadept.snapopen.open(nil, { folders = { '%.hg' } })
+-- @usage _M.textadept.snapopen.open()
+-- @usage _M.textadept.snapopen.open(buffer.filename:match('^.+/'), nil, true)
+-- @usage _M.textadept.snapopen.open(nil, '!%.lua$')
+-- @usage _M.textadept.snapopen.open(nil, { folders = { '%.hg' } })
-- @name open
function M.open(utf8_paths, filter, exclusive, depth)
if not utf8_paths then utf8_paths = {} end
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua
index d0ed65ee..29274b5c 100644
--- a/modules/textadept/snippets.lua
+++ b/modules/textadept/snippets.lua
@@ -5,7 +5,7 @@ local M = {}
--[[ This comment is for LuaDoc.
---
-- Provides Lua-style snippets for Textadept.
-module('_m.textadept.snippets')]]
+module('_M.textadept.snippets')]]
-- Markdown:
-- ## Overview