mason-larobina/luakit — pull request #228 by nathanharper (2014-01-01 22:05:32+00:00)
Title: fixed bug in follow command (issue #220, take two)

There were escaping problems when a user hits 'f' and tries to search a term with regex special characters.

I took a different approach this time now that I have a better idea of what the "pattern_maker" option in follow.lua is intended for. This will prevent crashes if the javascript regex fails to compile, and will reset the last state of the pattern so that a fresh search on all tags will be performed should the user later complete the unfinished regular expression. Patterns being searched as plain-text strings should not (and have not, at least in my testing) fail to compile, so it looks like the 'regex_escape' Lua function is doing its job.