diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/cpp/init.lua | 6 | ||||
-rw-r--r-- | modules/lua/init.lua | 6 | ||||
-rw-r--r-- | modules/textadept/adeptsense.lua | 2 | ||||
-rw-r--r-- | modules/textadept/bookmarks.lua | 2 | ||||
-rw-r--r-- | modules/textadept/command_entry.lua | 4 | ||||
-rw-r--r-- | modules/textadept/editing.lua | 4 | ||||
-rw-r--r-- | modules/textadept/filter_through.lua | 4 | ||||
-rw-r--r-- | modules/textadept/find.lua | 10 | ||||
-rw-r--r-- | modules/textadept/keys.lua | 4 | ||||
-rw-r--r-- | modules/textadept/menu.lua | 8 | ||||
-rw-r--r-- | modules/textadept/mime_types.lua | 4 | ||||
-rw-r--r-- | modules/textadept/run.lua | 4 | ||||
-rw-r--r-- | modules/textadept/session.lua | 2 | ||||
-rw-r--r-- | modules/textadept/snapopen.lua | 2 | ||||
-rw-r--r-- | modules/textadept/snippets.lua | 14 |
15 files changed, 38 insertions, 38 deletions
diff --git a/modules/cpp/init.lua b/modules/cpp/init.lua index 168699b4..a610528e 100644 --- a/modules/cpp/init.lua +++ b/modules/cpp/init.lua @@ -81,7 +81,7 @@ end -- Container for C/C++-specific key commands. -- @class table -- @name _G.keys.cpp -_G.keys.cpp = { +keys.cpp = { al = { m = { io.open_file, (_HOME..'/modules/cpp/init.lua'):iconv('UTF-8', _CHARSET) }, @@ -101,8 +101,8 @@ _G.keys.cpp = { -- Container for C/C++-specific snippets. -- @class table -- @name _G.snippets.cpp -if type(_G.snippets) == 'table' then - _G.snippets.cpp = { +if type(snippets) == 'table' then + snippets.cpp = { rc = 'reinterpret_cast<%1>(%2(%<selected_text>))', sc = 'static_cast<%1>(%2(%<selected_text>))', cc = 'const_cast<%1>(%2(%<selected_text>))', diff --git a/modules/lua/init.lua b/modules/lua/init.lua index cf43934e..198aed3c 100644 --- a/modules/lua/init.lua +++ b/modules/lua/init.lua @@ -170,7 +170,7 @@ events.connect(events.FILE_AFTER_SAVE, -- Container for Lua-specific key commands. -- @class table -- @name _G.keys.lua -_G.keys.lua = { +keys.lua = { al = { m = { io.open_file, (_HOME..'/modules/lua/init.lua'):iconv('UTF-8', _CHARSET) }, @@ -183,12 +183,12 @@ _G.keys.lua = { -- Snippets. -if type(_G.snippets) == 'table' then +if type(snippets) == 'table' then --- -- Container for Lua-specific snippets. -- @class table -- @name _G.snippets.lua - _G.snippets.lua = { + snippets.lua = { l = "local %1(expr)%2( = %3(value))", p = "print(%0)", f = "function %1(name)(%2(args))\n\t%0\nend", diff --git a/modules/textadept/adeptsense.lua b/modules/textadept/adeptsense.lua index f7166660..cadbebcb 100644 --- a/modules/textadept/adeptsense.lua +++ b/modules/textadept/adeptsense.lua @@ -610,7 +610,7 @@ function show_apidoc(sense) if apidocs.pos < 1 then apidocs.pos = #apidocs end buffer:call_tip_show(buffer.current_pos, apidocs[apidocs.pos]) end) - _G.timeout(1, function() + timeout(1, function() if pcall(buffer.call_tip_active, buffer) then return true end events.disconnect(events.CALL_TIP_CLICK, event_id) end) diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua index d4f01cf0..57e3da64 100644 --- a/modules/textadept/bookmarks.lua +++ b/modules/textadept/bookmarks.lua @@ -1,6 +1,6 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize +local L = locale.localize --- -- Bookmarks for the textadept module. diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua index 6eaf8daa..f0c771ed 100644 --- a/modules/textadept/command_entry.lua +++ b/modules/textadept/command_entry.lua @@ -1,8 +1,8 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -- Modified by Jay Gould. -local L = _G.locale.localize -local events = _G.events +local L = locale.localize +local events = events -- Environment for abbreviated commands. -- @class table diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index cf61af71..16ead02b 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -1,7 +1,7 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize -local events = _G.events +local L = locale.localize +local events = events local K = keys.KEYSYMS --- diff --git a/modules/textadept/filter_through.lua b/modules/textadept/filter_through.lua index 8f6b70db..a0cc0072 100644 --- a/modules/textadept/filter_through.lua +++ b/modules/textadept/filter_through.lua @@ -1,7 +1,7 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize -local events = _G.events +local L = locale.localize +local events = events --- -- Filter-Through for the textadept module. diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index 4010a5d6..a4298d67 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -1,7 +1,7 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize -local events = _G.events +local L = locale.localize +local events = events local find = gui.find local c = _SCINTILLA.constants @@ -165,7 +165,7 @@ function find.find_incremental() end events.connect(events.COMMAND_ENTRY_KEYPRESS, function(code) - local K = _G.keys.KEYSYMS + local K = keys.KEYSYMS if find.incremental then if K[code] == 'esc' then find.incremental = nil @@ -190,8 +190,8 @@ events.connect(events.COMMAND_ENTRY_COMMAND, function(text) end, 1) -- place before command_entry.lua's handler (if necessary) -- Optimize for speed. -local loadstring = _G.loadstring -local pcall = _G.pcall +local loadstring = loadstring +local pcall = pcall -- Runs the given code. -- This function is passed to string.gsub() in the replace() function. diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua index b4da1271..634e61e8 100644 --- a/modules/textadept/keys.lua +++ b/modules/textadept/keys.lua @@ -1,13 +1,13 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize +local L = locale.localize --- -- Defines key commands for Textadept. -- This set of key commands is pretty standard among other text editors. module('_m.textadept.keys', package.seeall) -local keys = _G.keys +local keys = keys local _buffer, _view = buffer, view local gui, m_textadept = gui, _m.textadept diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua index 9343efaa..3cab568d 100644 --- a/modules/textadept/menu.lua +++ b/modules/textadept/menu.lua @@ -1,9 +1,9 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -- Modified by Robert Gieseke. -local L = _G.locale.localize -local events = _G.events -local gui = _G.gui +local L = locale.localize +local events = events +local gui = gui --- -- Provides dynamic menus for Textadept. @@ -317,7 +317,7 @@ end -- entry is another table that corresponds to a particular menu. A menu can -- have a 'title' key with string value. Each menu item is either a submenu -- (another menu table) or a table consisting of two items: string menu text --- and an action table just like `_G.keys`'s action table. If the menu text is +-- and an action table just like `keys`'s action table. If the menu text is -- 'separator', a menu separator is created and no action table is required. function set_menubar(menubar) menu_actions = {} diff --git a/modules/textadept/mime_types.lua b/modules/textadept/mime_types.lua index dcc7f404..a7a4f4e1 100644 --- a/modules/textadept/mime_types.lua +++ b/modules/textadept/mime_types.lua @@ -1,7 +1,7 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize -local events = _G.events +local L = locale.localize +local events = events --- -- Handles file-specific settings. diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index f95b56f7..34171ce2 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -1,7 +1,7 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize -local events = _G.events +local L = locale.localize +local events = events --- -- Module for running/executing source files. diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua index a92ceb3e..f22307d6 100644 --- a/modules/textadept/session.lua +++ b/modules/textadept/session.lua @@ -1,6 +1,6 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize +local L = locale.localize --- -- Session support for the textadept module. diff --git a/modules/textadept/snapopen.lua b/modules/textadept/snapopen.lua index a155d74d..17979a2d 100644 --- a/modules/textadept/snapopen.lua +++ b/modules/textadept/snapopen.lua @@ -1,6 +1,6 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize +local L = locale.localize --- -- Snapopen for the textadept module. diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua index a3cfa313..a89931d1 100644 --- a/modules/textadept/snippets.lua +++ b/modules/textadept/snippets.lua @@ -1,6 +1,6 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -local L = _G.locale.localize +local L = locale.localize --- -- Provides Lua-style snippets for Textadept. @@ -104,9 +104,9 @@ module('_m.textadept.snippets', package.seeall) -- -- ## Example -- --- _G.snippets.snippet = '_G.snippets.%1 = \'%0\'' --- _G.snippets.file = '%<buffer.filename>' --- _G.snippets.lua = { +-- snippets.snippet = 'snippets.%1 = \'%0\'' +-- snippets.file = '%<buffer.filename>' +-- snippets.lua = { -- f = 'function %1(name)(%2(args))\n\t%0\nend' -- } -- @@ -182,7 +182,7 @@ function _insert(text) local lexer = buffer:get_lexer() trigger = buffer:text_range(buffer:word_start_position(buffer.current_pos), buffer.current_pos) - local snip = _G.snippets + local snip = snippets text = snip[trigger] if type(snip) == 'table' and snip[lexer] then snip = snip[lexer] end text = snip[trigger] or text @@ -215,14 +215,14 @@ end function _select() local list = {} local table_concat, type = table.concat, type - for trigger, text in pairs(_G.snippets) do + for trigger, text in pairs(snippets) do if type(text) == 'string' and trigger ~= '_NAME' and trigger ~= '_PACKAGE' then list[#list + 1] = table_concat({trigger, 'global', text }, '\0') end end local lexer = buffer:get_lexer() - for trigger, text in pairs(_G.snippets[lexer] or {}) do + for trigger, text in pairs(snippets[lexer] or {}) do if type(text) == 'string' then list[#list + 1] = table_concat({trigger, lexer, text }, '\0') end |