[hackers] [st] Move Shift + Insert to shortcut || "Roberto E. Vargas Caballero"

From: <hg_AT_suckless.org>
Date: Tue, 13 Nov 2012 20:08:51 +0100 (CET)

changeset: 400:ad5510bcd10a
user: "Roberto E. Vargas Caballero" <k0ga_AT_shike2.com>
date: Tue Nov 13 20:04:39 2012 +0100
files: config.def.h st.c
description:
Move Shift + Insert to shortcut
Shift + Insert is used like a hot key for paste the selection, so it is more
logical move it to shortcut array instead of having special code for it.
---
 config.def.h |    1 +
 st.c         |   13 +++----------
 2 files changed, 4 insertions(+), 10 deletions(-)
diff -r bed4588c42a3 -r ad5510bcd10a config.def.h
--- a/config.def.h	Tue Nov 13 20:04:34 2012 +0100
+++ b/config.def.h	Tue Nov 13 20:04:39 2012 +0100
_AT_@ -93,5 +93,6 @@
 	/* modifier		key		function	argument */
 	{ MODKEY|ShiftMask,	XK_Prior,	xzoom,		{.i = +1} },
 	{ MODKEY|ShiftMask,	XK_Next,	xzoom,		{.i = -1} },
+	{ ShiftMask,		XK_Insert,	selpaste,	{.i =  0} },
 };
 
diff -r bed4588c42a3 -r ad5510bcd10a st.c
--- a/st.c	Tue Nov 13 20:04:34 2012 +0100
+++ b/st.c	Tue Nov 13 20:04:39 2012 +0100
_AT_@ -261,6 +261,7 @@
 
 /* function definitions used in config.h */
 static void xzoom(const Arg *);
+static void selpaste(const Arg *);
 
 /* Config.h for applying patches and the configuration. */
 #include "config.h"
_AT_@ -360,7 +361,6 @@
 static void selinit(void);
 static inline bool selected(int, int);
 static void selcopy(void);
-static void selpaste(void);
 static void selscroll(int, int);
 
 static int utf8decode(char *, long *);
_AT_@ -750,7 +750,7 @@
 }
 
 void
-selpaste(void) {
+selpaste(const Arg *dummy) {
 	XConvertSelection(xw.dpy, XA_PRIMARY, sel.xtarget, XA_PRIMARY,
 			xw.win, CurrentTime);
 }
_AT_@ -821,7 +821,7 @@
 	}
 
 	if(e->xbutton.button == Button2) {
-		selpaste();
+		selpaste(NULL);
 	} else if(e->xbutton.button == Button1) {
 		sel.mode = 0;
 		getbuttoninfo(e, NULL, &sel.ex, &sel.ey);
_AT_@ -2743,13 +2743,6 @@
 				(shift ? "dacb":"DACB")[ksym - XK_Left]);
 			len = 3;
 			break;
-		case XK_Insert:
-			if(shift) {
-				selpaste();
-				return;
-			}
-			memcpy(buf, xstr, len);
-			break;
 		case XK_Return:
 			len = 0;
 			if(meta)
Received on Tue Nov 13 2012 - 20:08:51 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 13 2012 - 20:12:08 CET