Commit graph

144 commits

Author SHA1 Message Date
Tom Hinton
af6a4b83eb Make normal filtering of plain ASCII lines faster
This patch adds a field lines_not_ascii to the MenuState structure. The
nth entry is 0 unless the nth member of MenuState.lines has a non-ascii
codepoint in it.

All comparison functions (menu_match_cb type) take an additional
argument to tell them if the thing they are matching is not_ascii. They
can use this to determine whether to collate and case-fold the
input (for non-ascii strings), or whether to use strstr/strcasestr (for
ascii strings).

The change is not currently implemented for flex matching, due to my
laziness. However, it should be a simple enough matter to add.

For my large input of 400,000 lines, this reduces typical filtering time
to about ten microseconds from about 2 seconds.
2015-10-01 12:16:41 +01:00
QC
838c838d31 Try to fix #234 2015-09-27 12:57:54 +02:00
QC
8f1f03e6d2 Use cairo to do drawing. 2015-09-26 20:34:34 +02:00
Dave Davenport
5cc695e186 Add markup flag for dmenu. 2015-09-22 22:23:52 +02:00
QC
108c16e0d4 Default disable levenshtein 2015-09-20 10:32:49 +02:00
QC
b18d68eff2 Adjust new editor width 2015-09-19 12:57:48 +02:00
QC
442e235c24 Some cleanups, tweak uncrustify. 2015-09-19 12:21:30 +02:00
Dave Davenport
d2aad68bce Keep the line matched (if possible) when filtering. 2015-09-08 22:23:03 +02:00
Dave Davenport
13203c9de7 Refactor to make dmenu use Switcher, and make menu func use this. 2015-09-08 21:41:54 +02:00
Dave Davenport
ae26c13daf Allow switchers to run multiple times. 2015-09-07 19:10:44 +02:00
QC
e10aa09f74 Add hide scrollbar option. 2015-09-04 21:08:23 +02:00
Dave Davenport
2c45c02c7f Small cleanup. 2015-09-03 08:20:08 +02:00
Dave Davenport
d9a9d2489a Add separator color and style option. 2015-08-26 18:11:53 +02:00
QC
c170eae8c8 Issue: #207 add generic -filter mode. 2015-08-20 21:42:53 +02:00
Dave Davenport
1ca7141621 Add quick solution for #202, expose line-margin setting. 2015-08-04 09:42:14 +02:00
QC
77e5541ba5 Bug #200 implement -m mode 2015-08-02 15:45:52 +02:00
Dave Davenport
8d6a78939c Small cleanup + fail more gracefull here and there 2015-07-30 08:57:09 +02:00
Dave Davenport
93c01ccbd5 Add new event handling 2015-07-28 22:22:18 +02:00
Qball Cow
2bbd589f0d Add prefix to header guard. #191 2015-07-27 10:17:12 +02:00
Dave Davenport
8104997e6f Bug #191 rename header guard to not use reserved macro name. 2015-07-27 09:22:21 +02:00
Dave Davenport
98b8e583cb Make fuzzy matching available everywhere: #133 (-fuzzy) 2015-07-01 09:12:22 +02:00
Dave Davenport
1a188af2e9 Add markup support to error msg. 2015-06-08 23:23:33 +02:00
QC
a93aec02bd Add support for msg string with pango markup. 2015-05-23 20:06:06 +02:00
QC
9307a1668e Add -format option to dmenu. 2015-05-10 12:08:08 +02:00
QC
8d4e1ee8fa Rasi patch, allowing special keys, modifying return value.
In dmenu pressing alt-[1-9 will return the selected entry and set the return value to the
        pressed number.
2015-05-03 13:04:03 +02:00
Dave Davenport
a70404f128 First part of infrastructure for Issue: #131 customizable keybindings. 2015-04-30 21:52:30 +02:00
QC
99118420ea Support Levenshtein in dmenu.i #149 2015-04-16 21:13:45 +02:00
Dave Davenport
f64395e4e9 Remove unused code 2015-04-15 22:41:50 +02:00
QC
c1a8735e24 Re-enable background/foreground. Make theming method an option. 2015-04-11 12:04:14 +02:00
QC
2590ecf7e5 ADd new coloring scheme. 2015-04-06 17:13:26 +02:00
QC
39518b0e15 Add more user-colors. 2015-04-06 15:23:58 +02:00
Jason Pleau
34e578ef86 use '\033' instead of '\e' for output-formatting
'\e' is a GNU shortcut for \033. Also gcc complained (warning) that '\e'
was a non-ISO standard. Less warnings, the prettier :)
2015-04-05 17:40:43 -04:00
QC
91fcc76cb2 Help users that do not pass the read-the-manual stage. 2015-04-05 22:29:26 +02:00
QC
9b415e60a0 Fix crasher with fixed-lines off and 0 visible rows 2015-04-05 13:36:39 +02:00
QC
f2c4aff37c Add active/urgent color. 2015-04-03 18:40:07 +02:00
Dave Davenport
0d87cf12a3 Add combi viewer, where (selected) modi can be combined.
- Add active window highlighter.
2015-03-31 22:45:02 +02:00
QC
9ff5a615e9 Add combi viewer.
Use by adding combi to the list of enabled modi.
2015-03-30 20:12:22 +02:00
QC
55160c6eff Issue: #137, Parse /etc/hosts file. 2015-03-29 12:27:00 +02:00
QC
888260b06b Small cleanup 2015-03-27 20:50:48 +01:00
QC
b21368c005 OO-ify the Switchers. 2015-03-27 20:28:53 +01:00
Dave Davenport
a83a06a95c Re-add zeltak mode. 2015-02-24 17:35:09 +01:00
QC
dee0bfb821 Fix #128: Better handling of keybindings and remove deprecated launching.
See manpage.
2015-02-15 21:15:16 +01:00
Dave Davenport
a50219e903 Remove hmode. (Rather no implementation then a bad one.) 2015-02-10 07:42:40 +01:00
Dave Davenport
682907d340 Splitting over more files. 2015-02-09 19:35:51 +01:00
Dave Davenport
d9aef65ea7 Cleanups. 2015-02-04 09:37:34 +01:00
Dave Davenport
63fd534ba2 Move data around, constness, etc. 2015-02-03 08:21:59 +01:00
Dave Davenport
ca876feec6 Put i3 specific interaction code in separate file. 2015-02-02 14:49:19 +01:00
Dave Davenport
382b93ae03 Fix LLVM compiler warnings. 2015-02-01 10:43:28 +01:00
QC
661b65dd2a Introduce lazy-refilter mode for long lists. 2015-01-18 18:17:09 +01:00
Edwin Pujols
32b8281cfb Merge branch 'master' of https://github.com/DaveDavenport/rofi
Conflicts:
	doc/rofi-manpage.markdown
	doc/rofi.1
2015-01-12 15:48:04 -04:00
Dave Davenport
a8843af9f3 Add support for alternating row colors. 2015-01-12 19:14:46 +01:00
Edwin Pujols
d1ba4bd8dc Fix #102 - Add case sensitivity. 2015-01-12 09:25:20 -04:00
Dave Davenport
a28b6df307 Add support custom command. 2015-01-05 21:53:50 +01:00
Dave Davenport
781ca03f02 Small moving to helper. 2014-12-02 09:09:20 +01:00
Dave Davenport
2c9f33a1bd More commenting.
Code    Comment  Comment %      Blank      Total  File
------  ---------  ---------  ---------  ---------  -----------------
    36         69      65.7%          2        107  config.c
    66         31      32.0%         14        111  dmenu-dialog.c
   185         52      21.9%         19        256  helper.c
   179         66      26.9%         27        272  history.c
  1896        325      14.6%        345       2566  rofi.c
   197         45      18.6%         42        284  run-dialog.c
   144         31      17.7%         24        199  script-dialog.c
   171         42      19.7%         31        244  ssh-dialog.c
   350         69      16.5%         84        503  textbox.c
   151         37      19.7%         27        215  xrmoptions.c
    26          0       0.0%          5         31  helper-test.c
    65          6       8.5%         35        106  history-test.c
   109          5       4.4%         22        136  textbox-test.c
    34         33      49.3%         24         91  config.h
     5         10      66.7%          4         19  dmenu-dialog.h
    11         70      86.4%         10         91  helper.h
     9         46      83.6%          8         63  history.h
    83        128      60.7%         17        228  rofi.h
     4          8      66.7%          2         14  run-dialog.h
    11         26      70.3%          5         42  script-dialog.h
     4          8      66.7%          2         14  ssh-dialog.h
    64        142      68.9%         31        237  textbox.h
     6         13      68.4%          4         23  xrmoptions.h
2014-11-25 12:57:34 +01:00
Dave Davenport
471c0c5df7 Update comment of headers. 2014-11-25 08:27:08 +01:00
QC
f710912042 Add ctrl-/ as reverse tab. 2014-11-11 21:50:16 +01:00
QC
ab82941b5e Add sidebar modi to ROFI. 2014-11-09 13:10:24 +01:00
Dave Davenport
f56bd03a86 Add multi-line elements support. 2014-10-30 17:53:22 +01:00
QC
f728e3f03e Add separator option. 2014-10-19 19:42:02 +02:00
Dave Davenport
0462811800 Add flexible configuration for launching
* You can now specify links: {terminal} -e bash -e "{ssh-client} {host}"
    * Add test for this code.
2014-09-03 13:07:26 +02:00
Dave Davenport
0795cfda8d Add display text modi. 2014-08-27 19:44:15 +02:00
Dave Davenport
e44183b406 Refactor the to-long menu() function.
* Split out larger sub-parts into separate functions.
    * Create a state structure.
    * Remove zeltak mode.
2014-08-26 20:25:00 +02:00
Dave Davenport
26e1561622 Removed unused code. (NEAR and i3_mode) 2014-08-25 09:14:49 +02:00
Dave Davenport
62d4f0cdad Make rofi compile happily under clang.
* Set features in configure.ac
    * use config.h file, instead of hardcoded _GNU_SOURCE
      in each c file.
    * Fix mix up unsigned/signed.
2014-08-22 09:27:45 +02:00
QC
9af1d490a6 Make Rasi a happy boy, add character width mode. 2014-08-11 20:21:29 +02:00
QC
280c3d7f7f Using Glib's utf8 functions to do string collating.
* casefold and use utf-8 collating.
        * use g_utf8_next/prev for moving cursor.
2014-08-07 21:42:16 +02:00
Dave Davenport
b196649f10 Fix #76: DMENU returns 1 on cancel.
* Pull out dmenu, separate it from normal modi.
    * Give dmenu a return value (1 on cancel)
2014-08-05 09:07:41 +02:00
QC
5ddcac2514 Cleanup previous test commit. 2014-08-03 17:05:06 +02:00
QC
bd4aa3d2fa Fix #67 Allow alt-<num> to switch between modis 2014-07-21 23:19:45 +02:00
QC
cd4888a5cf Fix #65, Fix #63 Allow user to select list of modi's
* Add script_dialog, so user can add dialogs using a script.
    * Add a way to disable modi's
    * Add -show <modi> option.
2014-07-21 21:39:24 +02:00
QC
0f279b2995 Restructure some code, fix a small bug in dmenu mode.
* dmenu crashed on no input lines (wrong free)
 * Pass length of lines to menu function.
2014-07-20 12:29:27 +02:00
Dave Davenport
c86f28493a Make levenshtein sorting its own option.
* TODO: update manpage. (no md2man on this machine)
2014-07-16 08:42:42 +02:00
QC
f9149b5bdb Add option to disable history. 2014-06-05 21:55:47 +02:00
Dave Davenport
d361b6c445 Cleanup, integrate opacity. 2014-06-05 08:11:01 +02:00
QC
6fb7e345d0 Insert key paste secondary, shift-insert primary. 2014-06-02 13:29:43 +02:00
QC
477b10fb2f Comments? 2014-06-02 12:54:35 +02:00
QC
5769bc36f1 Make ssh set title public. 2014-05-22 10:03:36 +02:00
Qball Cow
beced5d36e Use true/false for hmode and fixed-num-lines
* Also update man page to reflect this.
2014-05-22 00:38:14 +02:00
Qball Cow
6d308cefd8 Remove value from config struct. 2014-05-20 11:22:03 +02:00
Qball Cow
85172743ee Keys via xresources, dump config. 2014-05-20 09:43:45 +02:00
QC
3157358c63 Add hmode to xrmoptions. 2014-05-19 22:12:54 +02:00
Qball Cow
0a95ba47fa Extra checks, first part cleanup 2014-05-19 21:02:05 +02:00
Qball Cow
cb15a57fb7 Remove memory wrappers, and use system stuff directly. 2014-05-19 16:48:50 +02:00
Qball Cow
b535533569 Add some initial columns support. 2014-05-19 09:50:09 +02:00
QC
f44fd74987 Add option to fix the size of rofi 2014-05-17 22:17:23 +02:00
QC
3ebd0d9001 Allow xoffset, fix bottom/right edge. 2014-05-15 21:55:23 +02:00
Qball Cow
82bdb5f348 Add a y-offset. 2014-05-15 16:54:35 +02:00
Dave Davenport
0d6556618e Allow window title to be set. issue #42 2014-04-22 11:11:46 +02:00
QC
c87312be36 Indent o mania. 2014-03-22 21:04:19 +01:00
Qball Cow
4d37cf35dc Small fix! 2014-03-18 10:55:25 +01:00
Qball Cow
5d5779ad1d Small i3 fix 2014-03-18 10:38:30 +01:00
QC
7e12aeb597 Remove profile. 2014-03-17 19:28:11 +01:00
Qball Cow
6e7f1b746a Rename main file. 2014-03-12 08:41:38 +01:00
Renamed from include/simpleswitcher.h (Browse further)