Open daniel-barrows opened 1 year ago
Yeah this is pretty confusing, but actually what the command says "keep only lines which are unique" and not "remove duplicates"... There should really be another option to filter out the duplicates? I mean VSCode offers something like this, like "Delete Duplicate lines".
But yeah, I also think "keep only unqiue lines" should be renamed to something better, coming from sublime this command behaves really different.
Yes, same here. Was expecting same as linux tool 'uniq' is doing. Confusing
Description
The function: "Keep only unique lines" should detect lines which have duplicates, and keep only one copy of the line, which previously had 2 or more copies. However, the function is deleting all lines with duplicates
Steps to reproduce
In any document, enter the following text:
Select the lines including both lines containing "a". It doesn't matter if leading or trailing newlines are included in the selection.
Open the Command Palette
Execute the command "Text Power Tools: Keep only unique lines"
What happens
The entire selection is deleted.
What I expected to happen
The selection is replaced with a single line containing "a"
Variations
I have similar results with multiple distinct duplicate lines, (A A B B =>),
or with duplicate lines between non-duplicate lines (A B B C => A C).
Environment
Recommendations
You may want to look into using the code from bibhasdn's Unique Lines extension. I've been using it for years without problems and it has always worked well, but I had thought Text Power Tools made it redundant.