Otherwise, stdin will have an error state of EOF, leading to wgetch()
returning -1, which is unexpected, given that we polled the file
descriptor for data.
- deal with empty lines correctly: single letter options that don't get
a newline were being missed
- entirely empty lines (empty line without a newline) weren't being used
correctly
- fix UB from not setting line=NULL
- use the delim parameter instead of hardcoding for newlines
Actually safe to perform the terminal cleanup here. We keep using
exit(3) and quick_exit(3) so that only one of them actually prints the
results to the screen.
- make nrows size_t to avoid casting so much
- add fast exit cases for 0 and 1 input values
- don't print anything if entries.ms==0 and RETURN is pressed
- don't match an empty line when reading values from stdin
- always use listsize to calculate listy
- in init code: for semantic meaning
- in the code for scroll: to fix an overflow bug
(listy+nrows >>> entries.ms)
- change WRITELIST macro to support two indexes
- make index_in_matched be set by the search part, so the scroll part
can rely on it; also reset it when entries.ms=0
- leave ifdef'd out a partial implementation for a version that when
updating search results tries to stick to the value instead of on-screen
position
- sorting the entries is just better UI
- filter_entries() is used to initialize a.ms to a.n, but it can lead to
weird things if all a.m members aren't also initialized