Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit f4e7a45

Browse files
fix bad jump to file
1 parent ac18538 commit f4e7a45

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/controllers/reviews-controller.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import path from 'path';
23
import PropTypes from 'prop-types';
34
import {createFragmentContainer, graphql} from 'react-relay';
45

@@ -159,7 +160,7 @@ export class BareReviewsController extends React.Component {
159160

160161
openFile = async (filePath, lineNumber) => {
161162
await this.props.workspace.open(
162-
filePath, {
163+
path.join(this.props.workdir, filePath), {
163164
initialLine: lineNumber - 1,
164165
initialColumn: 0,
165166
pending: true,

test/controllers/reviews-controller.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import {shallow} from 'enzyme';
3+
import path from 'path';
34

45
import {BareReviewsController} from '../../lib/controllers/reviews-controller';
56
import PullRequestCheckoutController from '../../lib/controllers/pr-checkout-controller';
@@ -758,7 +759,7 @@ describe('ReviewsController', function() {
758759
it('opens file on disk', async function() {
759760
await wrapper.find(ReviewsView).prop('openFile')('filepath', 420);
760761
assert.isTrue(atomEnv.workspace.open.calledWith(
761-
'filepath', {
762+
path.join(localRepository.getWorkingDirectoryPath(), 'filepath'), {
762763
initialLine: 420 - 1,
763764
initialColumn: 0,
764765
pending: true,

0 commit comments

Comments
 (0)