Skip to content

Commit 6f1ce2a

Browse files
committed
[tern addon] Make argument hint caching actually work
Closes codemirror#3934
1 parent 3265e11 commit 6f1ce2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

addon/tern/tern.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
var data = findDoc(ts, doc);
180180

181181
var argHints = ts.cachedArgHints;
182-
if (argHints && argHints.doc == doc && cmpPos(argHints.start, change.to) <= 0)
182+
if (argHints && argHints.doc == doc && cmpPos(argHints.start, change.to) >= 0)
183183
ts.cachedArgHints = null;
184184

185185
var changed = data.changed;
@@ -306,7 +306,7 @@
306306
ts.request(cm, {type: "type", preferFunction: true, end: start}, function(error, data) {
307307
if (error || !data.type || !(/^fn\(/).test(data.type)) return;
308308
ts.cachedArgHints = {
309-
start: pos,
309+
start: start,
310310
type: parseFnType(data.type),
311311
name: data.exprName || data.name || "fn",
312312
guess: data.guess,

0 commit comments

Comments
 (0)