Skip to content

Instantly share code, notes, and snippets.

@p4p1
Created December 20, 2023 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p4p1/173d0853a03f1abcafcf29883a82862d to your computer and use it in GitHub Desktop.
Save p4p1/173d0853a03f1abcafcf29883a82862d to your computer and use it in GitHub Desktop.
🐁🐁🐁🐁
/* diff file to add a double tap tab completion to st */
diff -up a/x.c b/x.c
--- a/x.c 2023-12-20 12:28:54.840325024 +0100
+++ b/x.c 2023-12-20 12:28:05.920133727 +0100
@@ -468,6 +468,7 @@ mouseaction(XEvent *e, uint release)
void
bpress(XEvent *e)
{
+ static int double_click = 0;
int btn = e->xbutton.button;
struct timespec now;
int snap;
@@ -484,6 +485,15 @@ bpress(XEvent *e)
return;
if (btn == Button1) {
+ double_click++;
+ }
+
+ if (double_click > 1) {
+ double_click = 0;
+ ttywrite("\t", strlen("\t"), 1);
+ }
+
+ if (btn == Button1) {
/*
* If the user clicks below predefined timeouts specific
* snapping behaviour is exposed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment