Improve ctrl-p matching