Ver a proveniência

Sorts remotes with default first

main
Eric Amodio há 6 anos
ascendente
cometimento
c4d418c4d7
2 ficheiros alterados com 9 adições e 1 eliminações
  1. +4
    -0
      CHANGELOG.md
  2. +5
    -1
      src/views/nodes/remotesNode.ts

+ 4
- 0
CHANGELOG.md Ver ficheiro

@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## [Unreleased]
### Changed
- Changes the sorting of remotes in the _Repositories_ view to sort the default remote first
### Fixed
- Fixes [#591](https://github.com/eamodio/vscode-gitlens/issues/591) - GitLens Error: Unable to open

+ 5
- 1
src/views/nodes/remotesNode.ts Ver ficheiro

@ -28,7 +28,11 @@ export class RemotesNode extends ViewNode {
return [new MessageNode(this.view, this, 'No remotes could be found')];
}
remotes.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' }));
remotes.sort(
(a, b) =>
(a.default ? -1 : 1) - (b.default ? -1 : 1) ||
a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' })
);
return [...Iterables.map(remotes, r => new RemoteNode(this.uri, this.view, this, r, this.repo))];
}

Carregando…
Cancelar
Guardar