aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com>2024-04-08 16:18:48 +0530
committerGitHub <noreply@github.com>2024-04-08 12:48:48 +0200
commitb303b64cffd4dcc81db469fdd0985182a16e9083 (patch)
tree46949c49643826eb048636e99dcc3da8d823b481
parent8fde5e902632712579802ed0464ebc1120fb2355 (diff)
downloadlite-xl-plugins-b303b64cffd4dcc81db469fdd0985182a16e9083.tar.gz
lite-xl-plugins-b303b64cffd4dcc81db469fdd0985182a16e9083.zip
Don't run `autosave` on user and project modules (#419)
* Update autosave.lua * Update autosave.lua * Update autosave.lua * Update manifest.json
-rw-r--r--manifest.json2
-rw-r--r--plugins/autosave.lua5
2 files changed, 5 insertions, 2 deletions
diff --git a/manifest.json b/manifest.json
index 1b03367..7f5ce59 100644
--- a/manifest.json
+++ b/manifest.json
@@ -182,7 +182,7 @@
"id": "autosave",
"mod_version": "3",
"path": "plugins/autosave.lua",
- "version": "0.1"
+ "version": "0.2"
},
{
"description": "Automatically saves files that were changed when the main window loses focus by switching to another application",
diff --git a/plugins/autosave.lua b/plugins/autosave.lua
index b63a6f6..03d7c58 100644
--- a/plugins/autosave.lua
+++ b/plugins/autosave.lua
@@ -63,7 +63,10 @@ end
function Doc:on_text_change(type)
-- check if file is saved
- if config.plugins.autosave.enabled and self.filename then
+ if config.plugins.autosave.enabled and self.filename
+ and self.abs_filename ~= system.absolute_path(USERDIR .. PATHSEP .. "init.lua")
+ and self.abs_filename ~= system.absolute_path(".lite_project.lua")
+ then
updatepress()
end
return on_text_change(self, type)