aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuldoman <giulio.lettieri@gmail.com>2023-03-15 19:24:04 +0100
committerGitHub <noreply@github.com>2023-03-15 19:24:04 +0100
commit6e674886825d36a08ea2e5b4ae89f9e996f79ac6 (patch)
treedd4bb161342aead67751a217e6715b509c58eeca
parent3bdc82b382f5cfbf05c7b2a3f454e9ed4985e2f7 (diff)
downloadlite-xl-plugins-6e674886825d36a08ea2e5b4ae89f9e996f79ac6.tar.gz
lite-xl-plugins-6e674886825d36a08ea2e5b4ae89f9e996f79ac6.zip
`primary_selection`: Add backoff time between retries (#215)
-rw-r--r--manifest.json2
-rw-r--r--plugins/primary_selection.lua1
2 files changed, 2 insertions, 1 deletions
diff --git a/manifest.json b/manifest.json
index 2d26d0f..3029058 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1032,7 +1032,7 @@
},
{
"description": "Adds middle mouse click copy/paste (primary selection). To use this plugin, `xclip` must be installed.",
- "version": "0.1",
+ "version": "0.2",
"path": "plugins/primary_selection.lua",
"id": "primary_selection",
"mod_version": "3"
diff --git a/plugins/primary_selection.lua b/plugins/primary_selection.lua
index 4f8d71a..e061b76 100644
--- a/plugins/primary_selection.lua
+++ b/plugins/primary_selection.lua
@@ -106,6 +106,7 @@ local function delayed_copy()
if written == 0 or not written then
if retry > 0 then
retry = retry - 1
+ coroutine.yield(((3-retry) ^ 2) * 0.05)
else
core.error("Error while setting primary selection. "..(err or ""))
break