Skip to content

Commit d840591

Browse files
committed
Merge branch 'decaf-runtime' of https://github.com/aminya/atom-julia-client into decaf-runtime
2 parents b7d46b8 + b5be10d commit d840591

File tree

3 files changed

+74
-45
lines changed

3 files changed

+74
-45
lines changed

lib/ui.coffee

Lines changed: 0 additions & 42 deletions
This file was deleted.

lib/ui.js

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
'use babel'
2+
import { CompositeDisposable, Disposable } from 'atom';
3+
4+
// TODO use babel to export ... from ...
5+
import notifications from './ui/notifications'
6+
import * as selector from './ui/selector'
7+
import views from './ui/views'
8+
import progress from './ui/progress'
9+
import * as layout from './ui/layout'
10+
import * as docpane from './ui/docs'
11+
import * as focusutils from './ui/focusutils'
12+
import * as cellhighlighter from './ui/cellhighlighter'
13+
14+
exports.notifications = notifications
15+
exports.selector = selector
16+
exports.views = views
17+
exports.progress = progress
18+
exports.layout = layout
19+
exports.docpane = docpane
20+
exports.focusutils = focusutils
21+
exports.cellhighlighter = cellhighlighter
22+
23+
let client;
24+
let subs;
25+
let ink;
26+
27+
export function activate(client_in) {
28+
client = client_in;
29+
subs = new CompositeDisposable;
30+
31+
notifications.activate();
32+
subs.add(atom.config.observe('julia-client.uiOptions.highlightCells', val => {
33+
if (val) {
34+
cellhighlighter.activate();
35+
} else {
36+
cellhighlighter.deactivate();
37+
}
38+
})
39+
);
40+
subs.add(new Disposable(() => {
41+
cellhighlighter.deactivate();
42+
})
43+
);
44+
45+
subs.add(client.onAttached(() => {
46+
notifications.show("Client Connected");
47+
})
48+
);
49+
subs.add(client.onDetached(() => {
50+
if (ink) {
51+
ink.Result.invalidateAll()
52+
}
53+
})
54+
);
55+
}
56+
57+
export function deactivate() {
58+
subs.dispose();
59+
}
60+
61+
export function consumeInk(ink_in) {
62+
ink = ink_in;
63+
views.ink = ink;
64+
selector.activate(ink);
65+
docpane.activate(ink);
66+
progress.activate(ink);
67+
focusutils.activate(ink);
68+
subs.add(new Disposable(() => {
69+
docpane.deactivate();
70+
progress.deactivate();
71+
focusutils.deactivate();
72+
}));
73+
}

lib/ui/layout.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ import {
99
outline
1010
} from '../runtime'
1111

12-
const documentation = () => {
13-
return require('../ui').docpane
14-
}
12+
import {docpane as documentation} from '../ui'
1513

1614
function specifiedPanes () {
1715
const panes = []

0 commit comments

Comments
 (0)