|
@@ -96,7 +96,7 @@ export class CompleterModel implements Completer.IModel {
|
|
|
|
|
|
// If the text change means that the original start point has been preceded,
|
|
// If the text change means that the original start point has been preceded,
|
|
// then the completion is no longer valid and should be reset.
|
|
// then the completion is no longer valid and should be reset.
|
|
- if (currentLine.length < originalLine.length) {
|
|
|
|
|
|
+ if (!this._subsetMatch && currentLine.length < originalLine.length) {
|
|
this.reset(true);
|
|
this.reset(true);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -301,13 +301,6 @@ export class CompleterModel implements Completer.IModel {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- // When the completer detects a common subset prefix for all options,
|
|
|
|
- // it updates the model and sets the model source to that value, but this
|
|
|
|
- // text change should be ignored.
|
|
|
|
- if (this._subsetMatch) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
const { text, column, line } = change;
|
|
const { text, column, line } = change;
|
|
const last = text.split('\n')[line][column - 1];
|
|
const last = text.split('\n')[line][column - 1];
|
|
|
|
|
|
@@ -337,12 +330,10 @@ export class CompleterModel implements Completer.IModel {
|
|
return undefined;
|
|
return undefined;
|
|
}
|
|
}
|
|
|
|
|
|
- const { start, end } = cursor;
|
|
|
|
- const { text } = original;
|
|
|
|
- const prefix = text.substring(0, start);
|
|
|
|
- const suffix = text.substring(end);
|
|
|
|
|
|
+ let { start, end } = cursor;
|
|
|
|
+ end = end + (this.current.text.length - this.original.text.length);
|
|
|
|
|
|
- return { offset: (prefix + patch).length, text: prefix + patch + suffix };
|
|
|
|
|
|
+ return { start, end, value: patch };
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|