Improve autocomplete triggers to make editing more intuitive
This commit is contained in:
parent
da7b03d3ed
commit
ece11167f3
|
@ -145,17 +145,15 @@ define([
|
|||
code.on('keydown', (cm, event) => {
|
||||
lastKey = event.keyCode;
|
||||
});
|
||||
code.on('endCompletion', () => {
|
||||
lastKey = 0;
|
||||
});
|
||||
code.on('change', (cm, change) => {
|
||||
if(cm.state.completionActive || change.origin === 'library') {
|
||||
if(change.origin === '+input') {
|
||||
if(lastKey === 13) {
|
||||
lastKey = 0;
|
||||
return;
|
||||
}
|
||||
} else if(change.origin !== 'complete') {
|
||||
return;
|
||||
}
|
||||
if(lastKey === 13 || lastKey === 8) {
|
||||
return;
|
||||
}
|
||||
lastKey = 0;
|
||||
CodeMirror.commands.autocomplete(cm, null, {
|
||||
completeSingle: false,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue