mirror of
https://github.com/chinchang/web-maker.git
synced 2025-06-20 06:29:18 +02:00
add manual completion for html with Ctrl-space. fixes #52
This commit is contained in:
@ -765,16 +765,16 @@ TextareaAutoComplete */
|
||||
// cursorScrollMargin: '20', has issue with scrolling
|
||||
profile: options.profile || '',
|
||||
extraKeys: {
|
||||
"Up": function (editor) {
|
||||
'Up': function (editor) {
|
||||
// Stop up/down keys default behavior when saveditempane is open
|
||||
if (isSavedItemsPaneOpen) { return; }
|
||||
CodeMirror.commands.goLineUp(editor);
|
||||
},
|
||||
"Down": function (editor) {
|
||||
'Down': function (editor) {
|
||||
if (isSavedItemsPaneOpen) { return; }
|
||||
CodeMirror.commands.goLineDown(editor);
|
||||
},
|
||||
"Shift-Tab": function(editor) {
|
||||
'Shift-Tab': function(editor) {
|
||||
CodeMirror.commands.indentAuto(editor);
|
||||
}
|
||||
}
|
||||
@ -785,17 +785,24 @@ TextareaAutoComplete */
|
||||
scope.setPreviewContent();
|
||||
}, updateDelay);
|
||||
});
|
||||
if (options.noAutocomplete) {
|
||||
cm.addKeyMap({
|
||||
'Ctrl-Space': 'autocomplete'
|
||||
});
|
||||
} else {
|
||||
cm.on('inputRead', function onChange(editor, input) {
|
||||
if (input.text[0] === ';' || input.text[0] === ' ') { return; }
|
||||
CodeMirror.commands.autocomplete(cm, null, { completeSingle: false })
|
||||
});
|
||||
}
|
||||
return cm;
|
||||
}
|
||||
|
||||
scope.cm.html = initEditor(htmlCode, {
|
||||
mode: 'htmlmixed',
|
||||
profile: 'xhtml',
|
||||
gutters: [ 'CodeMirror-linenumbers', 'CodeMirror-foldgutter' ]
|
||||
gutters: [ 'CodeMirror-linenumbers', 'CodeMirror-foldgutter' ],
|
||||
noAutocomplete: true
|
||||
});
|
||||
emmetCodeMirror(scope.cm.html);
|
||||
scope.cm.css = initEditor(cssCode, {
|
||||
|
Reference in New Issue
Block a user