Thread: ReaLauncher
View Single Post
Old 07-12-2018, 06:12 AM   #55
emarsk
Human being with feelings
 
Join Date: Dec 2016
Posts: 218
Default

Quote:
Originally Posted by _Stevie_ View Post
- would it be possible to make the filter field NOT case sensitive?
+1

Case-sensitive searches are usually the wrong choice.

To make it case-insensitive, add this code[*]:
Code:
  local function nocase (s)
    s = string.gsub(s, "%a", function (c)
          return "[" .. string.lower(c) .. string.upper(c) .. "]"
        end)
    return s
  end
  
  searchStr = nocase(searchStr)
after this line:

Code:
  local searchStr = GUI.Val("tb_filterRecentProjects")
---

*: (Shamelessly and absent-mindedly copy-pasted from Roberto Ierusalimschy's book "Programming in Lua, Fourth Edition").
emarsk is offline   Reply With Quote