Skip to content

Coding feedback #21

@salmanhalim

Description

@salmanhalim

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions