From 656a26504ae5251d1c543a5a03a9dfebff8dc683 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 26 Feb 2023 09:47:15 -0800 Subject: [PATCH] make FilteredList searching case insensitive by default --- docs/changelog.txt | 1 + docs/dev/Lua API.rst | 2 +- library/lua/gui/widgets.lua | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 1192fb03d..4e06d0e67 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -49,6 +49,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Lua - ``dfhack.screen.paintTile()``: you can now explicitly clear the interface cursor from a map tile by passing ``0`` as the tile value - ``widgets.Label``: token ``tile`` properties can now be functions that return a value +-@ ``widgets.FilteredList``: search key matching is now case insensitive by default -@ ``gui.INTERIOR_FRAME``: a panel frame style for use in highlighting off interior areas of a UI ## Removed diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index ef9b35f05..3b91d0ea9 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -5007,7 +5007,7 @@ construction that allows filtering the list by subwords of its items. In addition to passing through all attributes supported by List, it supports: -:case_sensitive: If true, matching is case sensitive. Defaults to true. +:case_sensitive: If ``true``, matching is case sensitive. Defaults to ``false``. :edit_pen: If specified, used instead of ``cursor_pen`` for the edit field. :edit_below: If true, the edit field is placed below the list instead of above. :edit_key: If specified, the edit field is disabled until this key is pressed. diff --git a/library/lua/gui/widgets.lua b/library/lua/gui/widgets.lua index d5d0ea7bf..ab018a50a 100644 --- a/library/lua/gui/widgets.lua +++ b/library/lua/gui/widgets.lua @@ -1926,7 +1926,7 @@ end FilteredList = defclass(FilteredList, Widget) FilteredList.ATTRS { - case_sensitive = true, + case_sensitive = false, edit_below = false, edit_key = DEFAULT_NIL, edit_ignore_keys = DEFAULT_NIL,