Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
trigger:
branches:
include:
- master
- releases/*

pr:
branches:
include:
- "*"

jobs:
- job: Linux
pool:
Expand Down
7 changes: 3 additions & 4 deletions lib/atom/atom-text-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {CompositeDisposable} from 'event-kit';

import RefHolder from '../models/ref-holder';
import {RefHolderPropType} from '../prop-types';
import {autobind, extractProps} from '../helpers';
import {extractProps} from '../helpers';

const editorUpdateProps = {
mini: PropTypes.bool,
Expand All @@ -28,7 +28,7 @@ export default class AtomTextEditor extends React.Component {
static propTypes = {
...editorCreationProps,

workspace: PropTypes.object.isRequired, // FIXME make more specific
workspace: PropTypes.object.isRequired,

didChangeCursorPosition: PropTypes.func,
didAddSelection: PropTypes.func,
Expand All @@ -50,7 +50,6 @@ export default class AtomTextEditor extends React.Component {

constructor(props) {
super(props);
autobind(this, 'observeSelections');

this.subs = new CompositeDisposable();

Expand Down Expand Up @@ -98,7 +97,7 @@ export default class AtomTextEditor extends React.Component {
this.subs.dispose();
}

observeSelections(selection) {
observeSelections = selection => {
const selectionSubs = new CompositeDisposable(
selection.onDidChangeRange(this.props.didChangeSelectionRange),
selection.onDidDestroy(() => {
Expand Down
6 changes: 2 additions & 4 deletions lib/atom/decoration.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import {Disposable} from 'event-kit';
import cx from 'classnames';

import {createItem, autobind, extractProps} from '../helpers';
import {createItem, extractProps} from '../helpers';
import {RefHolderPropType} from '../prop-types';
import {TextEditorContext} from './atom-text-editor';
import {DecorableContext} from './marker';
Expand Down Expand Up @@ -40,8 +40,6 @@ class BareDecoration extends React.Component {
constructor(props, context) {
super(props, context);

autobind(this, 'observeParents');

this.decorationHolder = new RefHolder();
this.editorSub = new Disposable();
this.decorableSub = new Disposable();
Expand Down Expand Up @@ -93,7 +91,7 @@ class BareDecoration extends React.Component {
}
}

observeParents() {
observeParents = () => {
this.decorationHolder.map(decoration => decoration.destroy());

const editorValid = this.props.editorHolder.map(editor => !editor.isDestroyed()).getOr(false);
Expand Down
3 changes: 3 additions & 0 deletions lib/models/repository-states/present.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default class Present extends State {
this.commitMessageTemplate = null;
this.fetchInitialMessage();

/* istanbul ignore else */
if (history) {
this.discardHistory.updateHistory(history);
}
Expand Down Expand Up @@ -165,6 +166,7 @@ export default class Present extends State {
keys.add(Keys.statusBundle);
}

/* istanbul ignore else */
if (keys.size > 0) {
this.cache.invalidate(Array.from(keys));
this.didUpdate();
Expand Down Expand Up @@ -557,6 +559,7 @@ export default class Present extends State {
destructiveAction,
partialDiscardFilePath,
);
/* istanbul ignore else */
if (snapshots) {
await this.saveDiscardHistory();
}
Expand Down
79 changes: 74 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"babel-plugin-istanbul": "4.1.6",
"chai": "4.1.2",
"chai-as-promised": "7.1.1",
"codecov": "3.1.0",
"codecov": "codecov/codecov-node#e427d90",
"cross-env": "5.2.0",
"cross-unzip": "0.2.1",
"dedent-js": "1.0.1",
Expand Down
8 changes: 7 additions & 1 deletion test/atom/atom-text-editor.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {mount} from 'enzyme';
import {mount, shallow} from 'enzyme';
import {TextBuffer} from 'atom';

import RefHolder from '../../lib/models/ref-holder';
Expand Down Expand Up @@ -35,6 +35,12 @@ describe('AtomTextEditor', function() {
assert.isTrue(workspace.isTextEditor(app.instance().refModel.get()));
});

it('returns undefined if the current model is unavailable', function() {
const emptyHolder = new RefHolder();
const app = shallow(<AtomTextEditor refModel={emptyHolder} />);
assert.isUndefined(app.instance().getModel());
});

it('configures the created text editor with props', function() {
mount(
<AtomTextEditor
Expand Down
Loading