Improving the functionality to list all occurences of a pattern in the current file