diff --git a/src/autocomplete.js b/src/autocomplete.js index c1e0c9065c1..272d970f4d3 100644 --- a/src/autocomplete.js +++ b/src/autocomplete.js @@ -52,11 +52,11 @@ var destroyCompleter = function(e, editor) { * There is an autocompletion popup, an optional inline ghost text renderer and a docuent tooltip popup inside. */ class Autocomplete { - constructor() { + constructor(editor) { this.autoInsert = false; this.autoSelect = true; this.autoShown = false; - this.exactMatch = false; + this.exactMatch = (editor && editor.getOption('exactMatch')) || false; this.inlineEnabled = false; this.keyboardHandler = new HashHandler(); this.keyboardHandler.bindKeys(this.commands); @@ -531,7 +531,7 @@ Autocomplete.for = function(editor) { Autocomplete.$sharedInstance = new Autocomplete(); editor.completer = Autocomplete.$sharedInstance; } else { - editor.completer = new Autocomplete(); + editor.completer = new Autocomplete(editor); editor.once("destroy", destroyCompleter); } return editor.completer; diff --git a/src/editor.js b/src/editor.js index 141306425c8..65bd33f29d6 100644 --- a/src/editor.js +++ b/src/editor.js @@ -2994,7 +2994,8 @@ config.defineOptions(Editor.prototype, "editor", { wrap: "session", indentedSoftWrap: "session", foldStyle: "session", - mode: "session" + mode: "session", + exactMatch: {initialValue: false} });