From e192e73a92eb896f9c8623d11a8c49ebbcb4c291 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Fri, 24 Jun 2011 17:41:51 -0400 Subject: Removed '_G' prefix from globals where necessary. --- modules/textadept/snippets.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'modules/textadept/snippets.lua') 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 mitchellcaladbolg.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 = '%' --- _G.snippets.lua = { +-- snippets.snippet = 'snippets.%1 = \'%0\'' +-- snippets.file = '%' +-- 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 -- cgit v1.2.3