feat(snippets): reduce delay before typing

Previously, we had a 50ms delay between deleting and pasting, as well as a 10ms delay between each keypress. This was intended to be on the safe side and sure the contents get resolved before pasting. However, the delay was a bit overkill, and this commit changes it to 5ms/2ms.
This commit is contained in:
ByteAtATime 2025-06-25 11:03:52 -07:00
parent 84438402e3
commit 59174dddca
No known key found for this signature in database

View file

@ -44,7 +44,7 @@ fn with_clipboard_text<F>(text: &str, paste_action: F) -> Result<()>
where
F: FnOnce() -> Result<()>,
{
const CLIPBOARD_PASTE_DELAY: Duration = Duration::from_millis(50);
const CLIPBOARD_PASTE_DELAY: Duration = Duration::from_millis(5);
let _guard = InternalClipboardGuard::new();
let mut clipboard = Clipboard::new().context("Failed to initialize clipboard")?;
@ -238,7 +238,7 @@ impl EvdevInputManager {
);
device.emit(&[press, syn.clone()])?;
device.emit(&[release, syn])?;
thread::sleep(Duration::from_millis(10));
thread::sleep(Duration::from_millis(2));
Ok(())
}