From aa1b4bb91e50b097392ce3bc2d957f577e926a45 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 9 May 2019 15:43:10 +0200 Subject: [PATCH] keep auto complete code close to each other --- src/editor/model.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/editor/model.js b/src/editor/model.js index 6834d31c4d..fb1e4801ba 100644 --- a/src/editor/model.js +++ b/src/editor/model.js @@ -114,6 +114,14 @@ export default class EditorModel { } } + _onAutoComplete = ({replacePart, replaceCaret, close}) => { + this._replacePart(this._autoCompletePartIdx, replacePart); + if (close) { + this._autoComplete = null; + this._autoCompletePartIdx = null; + } + } + /* updateCaret(caret) { // update active part here as well, hiding/showing autocomplete if needed @@ -202,14 +210,6 @@ export default class EditorModel { return new DocumentPosition(index, totalOffset - currentOffset); } - - _onAutoComplete = ({replacePart, replaceCaret, close}) => { - this._replacePart(this._autoCompletePartIdx, replacePart); - if (close) { - this._autoComplete = null; - this._autoCompletePartIdx = null; - } - } } class DocumentPosition {