Browse Source

Fixes #691 - Keep expand/collapse state on swap

main
Eric Amodio 5 years ago
parent
commit
10dfbc65d9
2 changed files with 8 additions and 3 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +7
    -3
      src/views/nodes/compareResultsNode.ts

+ 1
- 0
CHANGELOG.md View File

@ -34,6 +34,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#683](https://github.com/eamodio/vscode-gitlens/issues/683) - log.showSignature leads to stray files being displayed
- Fixes [#691](https://github.com/eamodio/vscode-gitlens/issues/691) - Auto-expand tree view on Swap Comparison
- Fixes the behavior of the _Open Line Changes with Previous Revision_ (`gitlens.diffLineWithPrevious`) command to follow the line history much better
## [9.5.1] - 2019-02-13

+ 7
- 3
src/views/nodes/compareResultsNode.ts View File

@ -7,9 +7,9 @@ import { log, Strings } from '../../system';
import { CompareView } from '../compareView';
import { CommitsQueryResults, ResultsCommitsNode } from './resultsCommitsNode';
import { ResultsFilesNode } from './resultsFilesNode';
import { ResourceType, ViewNode } from './viewNode';
import { ResourceType, SubscribeableViewNode, ViewNode } from './viewNode';
export class CompareResultsNode extends ViewNode<CompareView> {
export class CompareResultsNode extends SubscribeableViewNode<CompareView> {
constructor(
view: CompareView,
public readonly repoPath: string,
@ -52,7 +52,7 @@ export class CompareResultsNode extends ViewNode {
description = (repo && repo.formattedName) || this.uri.repoPath;
}
const item = new TreeItem(this.label, TreeItemCollapsibleState.Collapsed);
const item = new TreeItem(this.label, this._state || TreeItemCollapsibleState.Collapsed);
item.contextValue = ResourceType.CompareResults;
if (this._pinned) {
item.contextValue += '+pinned';
@ -118,6 +118,10 @@ export class CompareResultsNode extends ViewNode {
this.view.triggerNodeChange(this);
}
protected subscribe() {
return undefined;
}
private async getCommitsQuery(maxCount: number | undefined): Promise<CommitsQueryResults> {
const log = await Container.git.getLog(this.uri.repoPath!, {
maxCount: maxCount,

Loading…
Cancel
Save