diff options
author | Francesco <francesco.bbt@gmail.com> | 2021-08-17 22:44:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-17 22:44:17 +0200 |
commit | 49d3d21c987645b448184a752043946ed90d6031 (patch) | |
tree | b187286f2ed78fa9317f288dc0c5144840bcdad9 /plugins/lfautoinsert.lua | |
parent | a42a0d57b08a9080ed9fd8fa84f1269e3847980f (diff) | |
parent | 9689846686f77dc0aa1e6f4d31fbfc42998c2085 (diff) | |
download | lite-xl-plugins-49d3d21c987645b448184a752043946ed90d6031.tar.gz lite-xl-plugins-49d3d21c987645b448184a752043946ed90d6031.zip |
Merge pull request #45 from lite-xl/2.0
2.0 Merge
Diffstat (limited to 'plugins/lfautoinsert.lua')
-rw-r--r-- | plugins/lfautoinsert.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/lfautoinsert.lua b/plugins/lfautoinsert.lua index f03d9af..5f4148b 100644 --- a/plugins/lfautoinsert.lua +++ b/plugins/lfautoinsert.lua @@ -1,11 +1,11 @@ --- mod-version:1 -- lite-xl 1.16 +-- mod-version:2 -- lite-xl 2.0 local core = require "core" local command = require "core.command" local common = require "core.common" local config = require "core.config" local keymap = require "core.keymap" -config.lfautoinsert_map = { +config.plugins.lfautoinsert = { map = { ["{%s*\n"] = "}", ["%(%s*\n"] = ")", ["%f[[]%[%s*\n"] = "]", @@ -37,11 +37,11 @@ config.lfautoinsert_map = { ["%[%[%s*\n"] = "]]" } }, -} +} } local function get_autoinsert_map(filename) local map = {} - for pattern, closing in pairs(config.lfautoinsert_map) do + for pattern, closing in pairs(config.plugins.lfautoinsert.map) do if type(closing) == "table" then if common.match_pattern(filename, closing.file_patterns) then for p, e in pairs(closing.map) do @@ -102,7 +102,7 @@ keymap.add { return { add = function(file_patterns, map) table.insert( - config.lfautoinsert_map, + config.plugins.lfautoinsert.map, { file_patterns = file_patterns, map=map } ) end |