diff options
author | Guldoman <giulio.lettieri@gmail.com> | 2021-08-23 18:23:14 +0200 |
---|---|---|
committer | Guldoman <giulio.lettieri@gmail.com> | 2021-08-23 18:23:14 +0200 |
commit | 08ac68bd83c90eb84d11a88c39dca6eb55842cea (patch) | |
tree | 9b75b6d32c90770ca8af92c2a42eb8ca32104801 /plugins/lfautoinsert.lua | |
parent | dfe585a4459ea9a1acaa1a66b06a8ec18103e843 (diff) | |
download | lite-xl-plugins-08ac68bd83c90eb84d11a88c39dca6eb55842cea.tar.gz lite-xl-plugins-08ac68bd83c90eb84d11a88c39dca6eb55842cea.zip |
`lfautoinsert`: Avoid touching new files
Files that have been just created and not yet saved don't have a
filename, so we can't match it to a file ending.
Diffstat (limited to 'plugins/lfautoinsert.lua')
-rw-r--r-- | plugins/lfautoinsert.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/lfautoinsert.lua b/plugins/lfautoinsert.lua index 5f4148b..a156964 100644 --- a/plugins/lfautoinsert.lua +++ b/plugins/lfautoinsert.lua @@ -41,6 +41,7 @@ config.plugins.lfautoinsert = { map = { local function get_autoinsert_map(filename) local map = {} + if not filename then return map end for pattern, closing in pairs(config.plugins.lfautoinsert.map) do if type(closing) == "table" then if common.match_pattern(filename, closing.file_patterns) then |