Browse Source

Fixes issue with file/line pinning getting lost

main
Eric Amodio 4 years ago
parent
commit
1ed94eb19f
4 changed files with 17 additions and 1 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +12
    -1
      src/views/lineHistoryView.ts
  3. +2
    -0
      src/views/nodes/fileHistoryTrackerNode.ts
  4. +2
    -0
      src/views/nodes/lineHistoryTrackerNode.ts

+ 1
- 0
CHANGELOG.md View File

@ -49,6 +49,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Fixes an issue where many views wouldn't refresh properly when going from no items to some items
- Fixes an issue where _Publish Branch_ was incorrectly showing up on remote branches
- Fixes an issue where the _Open Directory Compare \*_ commands failed to work
- Fixes an issue where pinning a file/line to the _File History_ view or _Line History_ view would get lost if the view was collapsed and expanded
### Removed

+ 12
- 1
src/views/lineHistoryView.ts View File

@ -13,6 +13,8 @@ export class LineHistoryView extends ViewBase
constructor() {
super('gitlens.views.lineHistory', 'Line History');
void setContext(ContextKeys.ViewsLineHistoryEditorFollowing, true);
}
protected get showCollapseAll(): boolean {
@ -69,16 +71,25 @@ export class LineHistoryView extends ViewBase
}
private setEditorFollowing(enabled: boolean) {
const root = this.ensureRoot();
if (!root.hasUri) return;
void setContext(ContextKeys.ViewsLineHistoryEditorFollowing, enabled);
this.root?.setEditorFollowing(enabled);
if (this.description?.endsWith(pinnedSuffix)) {
if (enabled) {
this.description = this.description.substr(0, this.description.length - pinnedSuffix.length);
}
} else if (!enabled) {
} else if (!enabled && this.description != null) {
this.description += pinnedSuffix;
}
if (enabled) {
void root.ensureSubscription();
void this.refresh(true);
}
}
private setShowAvatars(enabled: boolean) {

+ 2
- 0
src/views/nodes/fileHistoryTrackerNode.ts View File

@ -119,6 +119,8 @@ export class FileHistoryTrackerNode extends SubscribeableViewNode
async refresh(reset: boolean = false) {
const cc = Logger.getCorrelationContext();
if (!this.canSubscribe) return false;
if (reset) {
this.setUri();
this.resetChild();

+ 2
- 0
src/views/nodes/lineHistoryTrackerNode.ts View File

@ -125,6 +125,8 @@ export class LineHistoryTrackerNode extends SubscribeableViewNode
async refresh(reset: boolean = false) {
const cc = Logger.getCorrelationContext();
if (!this.canSubscribe) return false;
if (reset) {
this.setUri();
this._editorContents = undefined;

Loading…
Cancel
Save