git ssb

0+

cel / noice



Commit 2a97bab5af5aba7ba6889e14c0fd47fe8110d85a

Change emacs keybinds for jumping to first/last entry

Signed-off-by: sin <sin@2f30.org>
sin committed on 4/9/2018, 12:42:51 PM
Parent: 155496adf93b918311950e3c70aa1d5d54565f5e

Files changed

config.def.hchanged
noice.1changed
noice.cchanged
config.def.hView
@@ -48,13 +48,13 @@
4848 { KEY_PPAGE, SEL_PGUP },
4949 { CONTROL('U'), SEL_PGUP },
5050 /* Home */
5151 { KEY_HOME, SEL_HOME },
52- { CONTROL('A'), SEL_HOME },
52 + { META('<'), SEL_HOME },
5353 { '^', SEL_HOME },
5454 /* End */
5555 { KEY_END, SEL_END },
56- { CONTROL('E'), SEL_END },
56 + { META('>'), SEL_END },
5757 { '$', SEL_END },
5858 /* Change dir */
5959 { 'c', SEL_CD },
6060 { '~', SEL_CDHOME },
noice.1View
@@ -1,5 +1,5 @@
1-.Dd March 5, 2018
1 +.Dd April 9, 2018
22 .Dt NOICE 1
33 .Os
44 .Sh NAME
55 .Nm noice
@@ -38,11 +38,11 @@
3838 .It Ic [Pgup] or C-u
3939 Scroll up half a page.
4040 .It Ic [Pgdown] or C-d
4141 Scroll down half a page.
42-.It Ic [Home], ^ or C-a
42 +.It Ic [Home], ^ or M-<
4343 Move to the first entry.
44-.It Ic [End], $ or C-e
44 +.It Ic [End], $ or M->
4545 Move to the last entry.
4646 .It Ic l, [Right], [Return] or C-m
4747 Open file or enter directory.
4848 .It Ic h, C-h, [Left] or [Backspace]
noice.cView
@@ -37,8 +37,9 @@
3737 #undef MIN
3838 #define MIN(x, y) ((x) < (y) ? (x) : (y))
3939 #define ISODD(x) ((x) & 1)
4040 #define CONTROL(c) ((c) ^ 0x40)
41 +#define META(c) ((c) ^ 0x80)
4142
4243 struct assoc {
4344 char *regex; /* Regex to match on filename */
4445 char *bin; /* Program */
@@ -334,21 +335,31 @@
334335 clearprompt();
335336 printw(str);
336337 }
337338
338-/* Returns SEL_* if key is bound and 0 otherwise.
339- * Also modifies the run and env pointers (used on SEL_{RUN,RUNARG}) */
340-int
341-nextsel(char **run, char **env)
339 +int xgetch(void)
342340 {
343- int c, i;
341 + int c;
344342
345343 c = getch();
346344 if (c == -1)
347345 idle++;
348346 else
349347 idle = 0;
348 + return c;
349 +}
350350
351 +/* Returns SEL_* if key is bound and 0 otherwise.
352 + * Also modifies the run and env pointers (used on SEL_{RUN,RUNARG}) */
353 +int
354 +nextsel(char **run, char **env)
355 +{
356 + int c, i;
357 +
358 + c = xgetch();
359 + if (c == 033)
360 + c = META(xgetch());
361 +
351362 for (i = 0; i < LEN(bindings); i++)
352363 if (c == bindings[i].sym) {
353364 *run = bindings[i].run;
354365 *env = bindings[i].env;

Built with git-ssb-web