mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 12:28:50 +03:00
keep auto complete code close to each other
This commit is contained in:
parent
5e6367ab57
commit
aa1b4bb91e
1 changed files with 8 additions and 8 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue