浏览代码

Dismiss the completer if the cursor leaves the range of the current
completion.

Ian Rose 6 年之前
父节点
当前提交
189a57d3f8
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      packages/completer/src/model.ts

+ 4 - 4
packages/completer/src/model.ts

@@ -251,7 +251,7 @@ export class CompleterModel implements Completer.IModel {
     }
 
     const { column, line } = change;
-    const { original } = this;
+    const { current, original } = this;
 
     if (!original) {
       return;
@@ -265,13 +265,13 @@ export class CompleterModel implements Completer.IModel {
     }
 
     // If a cursor change results in the cursor being set to a position that
-    // precedes the original request, cancel.
-    if (column < original.column) {
+    // precedes the original column, or is after the current column, cancel.
+    if (column < original.column || column > current.column) {
       this.reset(true);
       return;
     }
 
-    const { cursor, current } = this;
+    const { cursor } = this;
 
     if (!cursor || !current) {
       return;