|
From: | Johannes Altmanninger |
Subject: | Re: [RP] select patch |
Date: | Fri, 20 Jun 2014 14:17:01 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
Hi Jeff, Thanks for you patience. The function pointer seems to work in a test program, but I get this warning: gcc -o test test.c test.c: In function ‘main’: test.c:9:45: warning: initialization from incompatible pointer type compare_window_name_function my_compare = strncmp; ^ Meanwhile, I have done the following I have commented out the read_window() function since it is not used anywhere, and it calls find_window_name(), which works a bit different now. cmd_select works now as expected: first it tries to find an exact match then a case-insensitive match then a prefix match and finally a case-insensitive prefix match Then the first match is selected. I have added the "selectstyle" setting that can be set to "simple" or "cycle" If it is on "cycle", the program looks for a matching window as described above, but if the window is the same as the currently selected it tries to find another one within the current match_level (so if you have 2 windows named "Foo" and "foobar", then "select foo" will only match "Foo") I have attached the current diff, it works now as expected. I have defined the MATCH constants in window.h since find_window_name() is the only thing using them, should they be put elsewhere? (they look a bit odd) Now I am gonna try to refactor find_window_name() . How can I get rid of the warning above? On 06/20/2014 12:56 PM, Jeff Abrahamson
wrote:
|
select.diff
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |