search references: skip searching outside the module if the function is not exported (1187)
search: the search window (ctrl-h) doesn't work for variables (1192)
some additional cleanup of search code