mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-17 02:51:47 -05:00
Fixes jumpiness when opening a diff
This commit is contained in:
@@ -18,6 +18,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|||||||
- Removes unneeded `gitlens.stashExplorer.enabled` configuration setting since users can add or remove custom views natively now
|
- Removes unneeded `gitlens.stashExplorer.enabled` configuration setting since users can add or remove custom views natively now
|
||||||
- Removes unneeded `Toggle Git Stashed Explorer` command (`gitlens.stashExplorer.toggle`) since users can add or remove custom views natively now
|
- Removes unneeded `Toggle Git Stashed Explorer` command (`gitlens.stashExplorer.toggle`) since users can add or remove custom views natively now
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
- Fixes jumpiness when opening a diff to a certain line
|
||||||
|
|
||||||
## [4.3.3] - 2017-07-28
|
## [4.3.3] - 2017-07-28
|
||||||
## Added
|
## Added
|
||||||
- Adds progress indicator for when computing annotations takes a while
|
- Adds progress indicator for when computing annotations takes a while
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { commands, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
import { commands, Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
||||||
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
import { BuiltInCommands, GlyphChars } from '../constants';
|
import { BuiltInCommands, GlyphChars } from '../constants';
|
||||||
import { DiffWithPreviousCommandArgs } from './diffWithPrevious';
|
import { DiffWithPreviousCommandArgs } from './diffWithPrevious';
|
||||||
@@ -77,16 +77,18 @@ export class DiffLineWithPreviousCommand extends ActiveEditorCommand {
|
|||||||
this.git.getVersionedFile(args.commit.repoPath, args.commit.uri.fsPath, args.commit.sha)
|
this.git.getVersionedFile(args.commit.repoPath, args.commit.uri.fsPath, args.commit.sha)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (args.line !== undefined && args.line !== 0) {
|
||||||
|
if (args.showOptions === undefined) {
|
||||||
|
args.showOptions = {};
|
||||||
|
}
|
||||||
|
args.showOptions.selection = new Range(args.line, 0, args.line, 0);
|
||||||
|
}
|
||||||
|
|
||||||
await commands.executeCommand(BuiltInCommands.Diff,
|
await commands.executeCommand(BuiltInCommands.Diff,
|
||||||
Uri.file(lhs),
|
Uri.file(lhs),
|
||||||
Uri.file(rhs),
|
Uri.file(rhs),
|
||||||
`${path.basename(args.commit.uri.fsPath)} (${args.commit.shortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(gitUri.fsPath)} (${gitUri.shortSha})`,
|
`${path.basename(args.commit.uri.fsPath)} (${args.commit.shortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(gitUri.fsPath)} (${gitUri.shortSha})`,
|
||||||
args.showOptions);
|
args.showOptions);
|
||||||
|
|
||||||
if (args.line === undefined || args.line === 0) return undefined;
|
|
||||||
|
|
||||||
// TODO: Figure out how to focus the left pane
|
|
||||||
return await commands.executeCommand(BuiltInCommands.RevealLine, { lineNumber: args.line, at: 'center' });
|
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {
|
||||||
Logger.error(ex, 'DiffWithPreviousLineCommand', 'getVersionedFile');
|
Logger.error(ex, 'DiffWithPreviousLineCommand', 'getVersionedFile');
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { commands, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
import { commands, Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
||||||
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
import { BuiltInCommands, GlyphChars } from '../constants';
|
import { BuiltInCommands, GlyphChars } from '../constants';
|
||||||
import { GitService, GitUri } from '../gitService';
|
import { GitService, GitUri } from '../gitService';
|
||||||
@@ -45,16 +45,18 @@ export class DiffWithBranchCommand extends ActiveEditorCommand {
|
|||||||
try {
|
try {
|
||||||
const compare = await this.git.getVersionedFile(gitUri.repoPath, gitUri.fsPath, branch);
|
const compare = await this.git.getVersionedFile(gitUri.repoPath, gitUri.fsPath, branch);
|
||||||
|
|
||||||
|
if (args.line !== undefined && args.line !== 0) {
|
||||||
|
if (args.showOptions === undefined) {
|
||||||
|
args.showOptions = {};
|
||||||
|
}
|
||||||
|
args.showOptions.selection = new Range(args.line, 0, args.line, 0);
|
||||||
|
}
|
||||||
|
|
||||||
await commands.executeCommand(BuiltInCommands.Diff,
|
await commands.executeCommand(BuiltInCommands.Diff,
|
||||||
Uri.file(compare),
|
Uri.file(compare),
|
||||||
gitUri.fileUri(),
|
gitUri.fileUri(),
|
||||||
`${path.basename(gitUri.fsPath)} (${branch}) ${GlyphChars.ArrowLeftRight} ${path.basename(gitUri.fsPath)}`,
|
`${path.basename(gitUri.fsPath)} (${branch}) ${GlyphChars.ArrowLeftRight} ${path.basename(gitUri.fsPath)}`,
|
||||||
args.showOptions);
|
args.showOptions);
|
||||||
|
|
||||||
if (args.line === undefined || args.line === 0) return undefined;
|
|
||||||
|
|
||||||
// TODO: Figure out how to focus the left pane
|
|
||||||
return await commands.executeCommand(BuiltInCommands.RevealLine, { lineNumber: args.line, at: 'center' });
|
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {
|
||||||
Logger.error(ex, 'DiffWithBranchCommand', 'getVersionedFile');
|
Logger.error(ex, 'DiffWithBranchCommand', 'getVersionedFile');
|
||||||
|
|||||||
@@ -60,16 +60,18 @@ export class DiffWithNextCommand extends ActiveEditorCommand {
|
|||||||
this.git.getVersionedFile(args.commit.repoPath, args.commit.uri.fsPath, args.commit.sha)
|
this.git.getVersionedFile(args.commit.repoPath, args.commit.uri.fsPath, args.commit.sha)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (args.line !== undefined && args.line !== 0) {
|
||||||
|
if (args.showOptions === undefined) {
|
||||||
|
args.showOptions = {};
|
||||||
|
}
|
||||||
|
args.showOptions.selection = new Range(args.line, 0, args.line, 0);
|
||||||
|
}
|
||||||
|
|
||||||
await commands.executeCommand(BuiltInCommands.Diff,
|
await commands.executeCommand(BuiltInCommands.Diff,
|
||||||
Uri.file(lhs),
|
Uri.file(lhs),
|
||||||
Uri.file(rhs),
|
Uri.file(rhs),
|
||||||
`${path.basename(args.commit.uri.fsPath)} (${args.commit.shortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(args.commit.nextUri.fsPath)} (${args.commit.nextShortSha})`,
|
`${path.basename(args.commit.uri.fsPath)} (${args.commit.shortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(args.commit.nextUri.fsPath)} (${args.commit.nextShortSha})`,
|
||||||
args.showOptions);
|
args.showOptions);
|
||||||
|
|
||||||
if (args.line === undefined || args.line === 0) return undefined;
|
|
||||||
|
|
||||||
// TODO: Figure out how to focus the left pane
|
|
||||||
return await commands.executeCommand(BuiltInCommands.RevealLine, { lineNumber: args.line, at: 'center' });
|
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {
|
||||||
Logger.error(ex, 'DiffWithNextCommand', 'getVersionedFile');
|
Logger.error(ex, 'DiffWithNextCommand', 'getVersionedFile');
|
||||||
|
|||||||
@@ -59,16 +59,18 @@ export class DiffWithPreviousCommand extends ActiveEditorCommand {
|
|||||||
this.git.getVersionedFile(args.commit.repoPath, args.commit.previousUri.fsPath, args.commit.previousSha)
|
this.git.getVersionedFile(args.commit.repoPath, args.commit.previousUri.fsPath, args.commit.previousSha)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (args.line !== undefined && args.line !== 0) {
|
||||||
|
if (args.showOptions === undefined) {
|
||||||
|
args.showOptions = {};
|
||||||
|
}
|
||||||
|
args.showOptions.selection = new Range(args.line, 0, args.line, 0);
|
||||||
|
}
|
||||||
|
|
||||||
await commands.executeCommand(BuiltInCommands.Diff,
|
await commands.executeCommand(BuiltInCommands.Diff,
|
||||||
Uri.file(lhs),
|
Uri.file(lhs),
|
||||||
Uri.file(rhs),
|
Uri.file(rhs),
|
||||||
`${path.basename(args.commit.previousUri.fsPath)} (${args.commit.previousShortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(args.commit.uri.fsPath)} (${args.commit.shortSha})`,
|
`${path.basename(args.commit.previousUri.fsPath)} (${args.commit.previousShortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(args.commit.uri.fsPath)} (${args.commit.shortSha})`,
|
||||||
args.showOptions);
|
args.showOptions);
|
||||||
|
|
||||||
if (args.line === undefined || args.line === 0) return undefined;
|
|
||||||
|
|
||||||
// TODO: Figure out how to focus the left pane
|
|
||||||
return await commands.executeCommand(BuiltInCommands.RevealLine, { lineNumber: args.line, at: 'center' });
|
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {
|
||||||
Logger.error(ex, 'DiffWithPreviousCommand', 'getVersionedFile');
|
Logger.error(ex, 'DiffWithPreviousCommand', 'getVersionedFile');
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { commands, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
import { commands, Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
||||||
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
import { BuiltInCommands, GlyphChars } from '../constants';
|
import { BuiltInCommands, GlyphChars } from '../constants';
|
||||||
import { GitService, GitUri } from '../gitService';
|
import { GitService, GitUri } from '../gitService';
|
||||||
@@ -48,16 +48,18 @@ export class DiffWithRevisionCommand extends ActiveEditorCommand {
|
|||||||
|
|
||||||
const compare = await this.git.getVersionedFile(gitUri.repoPath, gitUri.fsPath, pick.commit.sha);
|
const compare = await this.git.getVersionedFile(gitUri.repoPath, gitUri.fsPath, pick.commit.sha);
|
||||||
|
|
||||||
|
if (args.line !== undefined && args.line !== 0) {
|
||||||
|
if (args.showOptions === undefined) {
|
||||||
|
args.showOptions = {};
|
||||||
|
}
|
||||||
|
args.showOptions.selection = new Range(args.line, 0, args.line, 0);
|
||||||
|
}
|
||||||
|
|
||||||
await commands.executeCommand(BuiltInCommands.Diff,
|
await commands.executeCommand(BuiltInCommands.Diff,
|
||||||
Uri.file(compare),
|
Uri.file(compare),
|
||||||
gitUri.fileUri(),
|
gitUri.fileUri(),
|
||||||
`${path.basename(gitUri.fsPath)} (${pick.commit.shortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(gitUri.fsPath)}`,
|
`${path.basename(gitUri.fsPath)} (${pick.commit.shortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(gitUri.fsPath)}`,
|
||||||
args.showOptions);
|
args.showOptions);
|
||||||
|
|
||||||
if (args.line === undefined || args.line === 0) return undefined;
|
|
||||||
|
|
||||||
// TODO: Figure out how to focus the left pane
|
|
||||||
return await commands.executeCommand(BuiltInCommands.RevealLine, { lineNumber: args.line, at: 'center' });
|
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {
|
||||||
Logger.error(ex, 'DiffWithRevisionCommand', 'getVersionedFile');
|
Logger.error(ex, 'DiffWithRevisionCommand', 'getVersionedFile');
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { commands, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
import { commands, Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
||||||
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
import { BuiltInCommands, GlyphChars } from '../constants';
|
import { BuiltInCommands, GlyphChars } from '../constants';
|
||||||
import { GitCommit, GitService, GitUri } from '../gitService';
|
import { GitCommit, GitService, GitUri } from '../gitService';
|
||||||
@@ -51,16 +51,18 @@ export class DiffWithWorkingCommand extends ActiveEditorCommand {
|
|||||||
try {
|
try {
|
||||||
const compare = await this.git.getVersionedFile(args.commit.repoPath, args.commit.uri.fsPath, args.commit.sha);
|
const compare = await this.git.getVersionedFile(args.commit.repoPath, args.commit.uri.fsPath, args.commit.sha);
|
||||||
|
|
||||||
|
if (args.line !== undefined && args.line !== 0) {
|
||||||
|
if (args.showOptions === undefined) {
|
||||||
|
args.showOptions = {};
|
||||||
|
}
|
||||||
|
args.showOptions.selection = new Range(args.line, 0, args.line, 0);
|
||||||
|
}
|
||||||
|
|
||||||
await commands.executeCommand(BuiltInCommands.Diff,
|
await commands.executeCommand(BuiltInCommands.Diff,
|
||||||
Uri.file(compare),
|
Uri.file(compare),
|
||||||
Uri.file(path.resolve(gitUri.repoPath, workingFileName)),
|
Uri.file(path.resolve(gitUri.repoPath, workingFileName)),
|
||||||
`${path.basename(args.commit.uri.fsPath)} (${args.commit.shortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(workingFileName)}`,
|
`${path.basename(args.commit.uri.fsPath)} (${args.commit.shortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(workingFileName)}`,
|
||||||
args.showOptions);
|
args.showOptions);
|
||||||
|
|
||||||
if (args.line === undefined || args.line === 0) return undefined;
|
|
||||||
|
|
||||||
// TODO: Figure out how to focus the left pane
|
|
||||||
return await commands.executeCommand(BuiltInCommands.RevealLine, { lineNumber: args.line, at: 'center' });
|
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {
|
||||||
Logger.error(ex, 'DiffWithWorkingCommand', 'getVersionedFile');
|
Logger.error(ex, 'DiffWithWorkingCommand', 'getVersionedFile');
|
||||||
|
|||||||
Reference in New Issue
Block a user