Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Also generally clean up input handling a bit.
|
|
|
|
|
|
This replaces the --fuzzy-match algorithm. Available choices are normal,
prefix and fuzzy. Levenshtein distance was investigated, but it seems
pretty rubbish for tofi's use case, where you normally want a good match when
you've only typed a small portion of the target string.
|
|
|
|
|
|
|
|
This turned out to be much more complex than anticipated, and the
potential for bugs is therefore quite high.
|
|
Previously, string vectors were built by reading input line-by line, and
multiple copies of string vectors were made when searching.
Now, input is read into one big buffer, and string vectors only contain
references to the strings in this buffer. This both speeds up reading of
input, and avoids unnecessary copying of strings in various places.
The main downside currently is that input read from stdin is no longer
UTF-8 normalised. This means, for example, that a search for `e` won't
necessarily match `é`. Normalisation is very slow relative to the rest
of tofi, however, and not needed for most use-cases. This could either
be solved by accepting the slowdown, or making this an option, such as
--unicode or --unicode-normalize.
|
|
|
|
|
|
|
|
This fixes an issue where receiving multiple keypresses in the time
taken to draw a frame could cause input to be out of sync with the
display.
|
|
All text handling should now be explicitly UTF-8 or UTF-32, removing the
ambiguity around wchar_t and related functions.
|
|
Also changed keyboard shortcuts to use physical keycodes, rather than
XKB keysyms. This means shortcuts don't shift when keyboard layout is
changed.
|