Makes history-substring-search use term specific up and down buttons. Fixes #2089.