-
Notifications
You must be signed in to change notification settings - Fork 5
Description
I like how the search pattern skips matches in single-line comments, but maybe that should be an option: sometimes, people comment lines out temporarily and removing the import will suddenly cause build problems if they uncomment those lines later.
A method called 'highlight_unused_imports' shouldn't do anything other than highlight or possibly remove highlights. It really shouldn't also be used to remove lines. As an easy fix, you could rename it to 'highlight_or_remove_unused_imports', but the ideal solution would have a separate function that returns a list of lines that match and have two different functions that call it, one that highlights them and one that removes them.
You can call winsaveview() and winrestview() to restore the cursor and window position more accurately than simply restoring the line and column.