editor.on(“ keydown”,function(cm,event){ // console.log(CodeMirror) 如果( !(event.ctrlKey)&& (event.keyCode> = 65 && event.keyCode <= 90)|| (event.keyCode> = 97 && event.keyCode <= 122)|| (event.keyCode> = 46 && event.keyCode <= 57) ){ cm.showHint({提示:CodeMirror.hint.anyword,completeSingle:false}); } }); enter image description here
答案 0 :(得分:0)
editor.on("keydown", function (cm, event) {
// console.log(CodeMirror)
if (
!(event.ctrlKey) &&
(event.keyCode >= 65 && event.keyCode <= 90) ||
(event.keyCode >= 97 && event.keyCode <= 122) ||
(event.keyCode >= 46 && event.keyCode <= 57)
) {
cm.showHint({hint: CodeMirror.hint.anyword,completeSingle: false});
}
});