Skip to content

Commit 4ab4fd1

Browse files
authored
Merge pull request #643 from JunoLab/avi/updatesymbols
don't update symbols on editor switching
2 parents afbd2cd + 6992462 commit 4ab4fd1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/runtime/outline.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function activate (ink) {
1818
subs.add(client.onDetached(() => pane.setItems([])))
1919

2020
let edSubs = new CompositeDisposable()
21-
subs.add(atom.workspace.onDidChangeActiveTextEditor(ed => {
21+
subs.add(atom.workspace.onDidChangeActiveTextEditor(throttle(ed => {
2222
if (!ed) return
2323

2424
edSubs.dispose()
@@ -60,14 +60,18 @@ export function activate (ink) {
6060
pane.setItems(outline)
6161
}, 300)))
6262

63-
updateEditor(ed).then(outlineItems => {
63+
updateEditor(ed, {
64+
updateSymbols: false
65+
}).then(outlineItems => {
6466
outline = handleOutline(ed, edSubs, outlineItems)
6567
})
66-
}))
68+
}, 300)))
6769
}
6870

6971
// NOTE: update outline and symbols cache all in one go
70-
function updateEditor (editor) {
72+
function updateEditor (editor, options = {
73+
updateSymbols: true
74+
}) {
7175
if (!client.isActive()) {
7276
return new Promise((resolve) => resolve([]))
7377
}
@@ -80,6 +84,8 @@ function updateEditor (editor) {
8084
text,
8185
mod,
8286
path,
87+
// https://github.com/JunoLab/Juno.jl/issues/407
88+
updateSymbols: options.updateSymbols
8389
})
8490
}
8591

0 commit comments

Comments
 (0)