4 Commits

Author SHA1 Message Date
61a141203b Bump liberty and version, update NEWS 2021-12-21 05:46:28 +01:00
48482ef2e5 Make incremental search more useful
Make it unanchored, as well as case-insensitive.
2021-12-21 05:46:22 +01:00
840c69767c Prepare a NEWS entry for the next release 2021-12-08 19:05:58 +01:00
a14a907b18 Indicate that a stream download is in progress 2021-12-08 18:58:03 +01:00
4 changed files with 26 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.0) cmake_minimum_required (VERSION 3.0)
project (nncmpp VERSION 1.1.1 LANGUAGES C) project (nncmpp VERSION 1.2.0 LANGUAGES C)
# Moar warnings # Moar warnings
if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC) if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC)

11
NEWS
View File

@@ -1,3 +1,14 @@
1.2.0 (2021-12-21)
* Added ability to control the volume of MPD's current PulseAudio sink
* Now fetching Internet stream information asynchronously
* Added basic incremental search, normally bound to C-s, in all tabs
* Fixed jumping to the beginning of the queue after deleting items
1.1.1 (2021-11-04) 1.1.1 (2021-11-04)
* Terminal focus in/out events no longer ring the terminall bell * Terminal focus in/out events no longer ring the terminall bell

Submodule liberty updated: 782a9a5977...7e8e085c97

View File

@@ -2089,6 +2089,8 @@ app_write_mpd_status (struct row_buffer *buf)
row_buffer_append (buf, msg, APP_ATTR (HIGHLIGHT)); row_buffer_append (buf, msg, APP_ATTR (HIGHLIGHT));
free (msg); free (msg);
} }
else if (g.poller_curl.registered)
row_buffer_append (buf, "Downloading...", APP_ATTR (NORMAL));
else if (str_map_find (map, "updating_db")) else if (str_map_find (map, "updating_db"))
row_buffer_append (buf, "Updating database...", APP_ATTR (NORMAL)); row_buffer_append (buf, "Updating database...", APP_ATTR (NORMAL));
else else
@@ -2348,12 +2350,17 @@ static size_t
incremental_search_match (const ucs4_t *needle, size_t len, incremental_search_match (const ucs4_t *needle, size_t len,
const struct row_buffer *row) const struct row_buffer *row)
{ {
// TODO: case-insensitive search, wilcards, regexps, something easy to use // XXX: this is slow and simplistic, but unistring is awkward to use
size_t i = 0; size_t best = 0;
for (; i < len && i < row->chars_len; i++) for (size_t start = 0; start < row->chars_len; start++)
if (needle[i] != row->chars[i].c) {
break; size_t i = 0;
return i; for (; i < len && start + i < row->chars_len; i++)
if (uc_tolower(needle[i]) != uc_tolower(row->chars[start + i].c))
break;
best = MAX (best, i);
}
return best;
} }
static void static void