fix: restore proper toggling of autocompleteOnTyping
This commit is contained in:
parent
dfed35c1f4
commit
b4cf010eee
|
@ -27,20 +27,20 @@
|
|||
const originalHelper = CodeMirror.hint.css || (() => {});
|
||||
let cssMedia, cssProps, cssPropsValues;
|
||||
|
||||
const aot = prefs.get('editor.autocompleteOnTyping');
|
||||
CodeMirror.defineOption('autocompleteOnTyping', aot, aotToggled);
|
||||
if (aot) cmFactory.globalSetOption('autocompleteOnTyping', true);
|
||||
const AOT_ID = 'autocompleteOnTyping';
|
||||
const AOT_PREF_ID = 'editor.' + AOT_ID;
|
||||
const aot = prefs.get(AOT_PREF_ID);
|
||||
CodeMirror.defineOption(AOT_ID, aot, (cm, value) => {
|
||||
cm[value ? 'on' : 'off']('changes', autocompleteOnTyping);
|
||||
cm[value ? 'on' : 'off']('pick', autocompletePicked);
|
||||
});
|
||||
prefs.subscribe(AOT_PREF_ID, (key, val) => cmFactory.globalSetOption(AOT_ID, val), {runNow: aot});
|
||||
|
||||
CodeMirror.registerHelper('hint', 'css', helper);
|
||||
CodeMirror.registerHelper('hint', 'stylus', helper);
|
||||
|
||||
tokenHooks['/'] = tokenizeUsoVariables;
|
||||
|
||||
function aotToggled(cm, value) {
|
||||
cm[value ? 'on' : 'off']('changes', autocompleteOnTyping);
|
||||
cm[value ? 'on' : 'off']('pick', autocompletePicked);
|
||||
}
|
||||
|
||||
async function helper(cm) {
|
||||
const pos = cm.getCursor();
|
||||
const {line, ch} = pos;
|
||||
|
|
Loading…
Reference in New Issue
Block a user