Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions PSReadLine/Completion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,31 +298,6 @@ private CommandCompletion GetCompletions()
var length = _tabCompletions.ReplacementLength;
if (start < 0 || start > _singleton._buffer.Length) return null;
if (length < 0 || length > (_singleton._buffer.Length - start)) return null;

if (_tabCompletions.CompletionMatches.Count > 1)
{
// Filter out apparent duplicates -- the 'ListItemText' is exactly the same.
var hashSet = new HashSet<string>();
var matches = _tabCompletions.CompletionMatches;
List<int> indices = null;

for (int i = 0; i < matches.Count; i++)
{
if (!hashSet.Add(matches[i].ListItemText))
{
indices ??= new List<int>();
indices.Add(i);
}
}

if (indices is not null)
{
for (int i = indices.Count - 1; i >= 0; i--)
{
matches.RemoveAt(indices[i]);
}
}
}
}
catch (Exception)
{
Expand Down