[hackers] [wmii] Slight `wimenu -c` fix. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Fri, 29 May 2009 22:54:41 +0000 (UTC)

changeset: 2473:141755859b1a
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Fri May 29 18:54:38 2009 -0400
files: cmd/menu/fns.h cmd/menu/main.c cmd/menu/menu.c
description:
Slight `wimenu -c` fix.

diff -r ad03a544b297 -r 141755859b1a cmd/menu/fns.h
--- a/cmd/menu/fns.h Fri May 29 16:03:54 2009 -0400
+++ b/cmd/menu/fns.h Fri May 29 18:54:38 2009 -0400
@@ -20,7 +20,7 @@
 void debug(int, const char*, ...);
 Item* filter_list(Item*, char*);
 void init_screens(int);
-void update_filter(void);
+void update_filter(bool);
 
 /* menu.c */
 void menu_draw(void);
diff -r ad03a544b297 -r 141755859b1a cmd/menu/main.c
--- a/cmd/menu/main.c Fri May 29 16:03:54 2009 -0400
+++ b/cmd/menu/main.c Fri May 29 18:54:38 2009 -0400
@@ -102,7 +102,7 @@
         }
         input.filter_start = strtol(s, nil, 10);
         items = populate_list(cmplbuf, false);
- update_filter();
+ update_filter(false);
         menu_draw();
 }
 
@@ -141,7 +141,7 @@
 }
 
 void
-update_filter(void) {
+update_filter(bool print) {
         char *filter;
 
         filter = input.string + min(input.filter_start, input.pos - input.string);
@@ -150,7 +150,7 @@
 
         matchidx = nil;
         matchfirst = matchstart = filter_list(items, filter);
- if(alwaysprint) {
+ if(alwaysprint && print) {
                 write(1, input.string, input.pos - input.string);
                 write(1, "", 1);
                 write(1, input.pos, input.end - input.pos + 1);
@@ -297,7 +297,7 @@
                 ixp_listen(&srv, cmplbuf->fid, inbuf, check_competions, nil);
 
         caret_insert("", true);
- update_filter();
+ update_filter(false);
 
         if(!nokeys)
                 parse_keys(binding_spec);
diff -r ad03a544b297 -r 141755859b1a cmd/menu/menu.c
--- a/cmd/menu/menu.c Fri May 29 16:03:54 2009 -0400
+++ b/cmd/menu/menu.c Fri May 29 18:54:38 2009 -0400
@@ -78,7 +78,7 @@
         default:
                 goto next;
         }
- update_filter();
+ update_filter(true);
 next:
         switch(op) {
         case ACCEPT:
@@ -276,7 +276,7 @@
         if(action == nil || action[0] == nil) {
                 if(num && !iscntrl(buf[0])) {
                         caret_insert(buf, false);
- update_filter();
+ update_filter(true);
                         menu_draw();
                 }
         }
Received on Fri May 29 2009 - 22:54:41 UTC

This archive was generated by hypermail 2.2.0 : Fri May 29 2009 - 23:00:06 UTC