1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-27 00:30:09 +02:00

integrate new emmet plugin

This commit is contained in:
Kushagra Gour
2018-01-14 00:28:38 +05:30
parent 89219475a7
commit fdf792f163
2 changed files with 17 additions and 43086 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1258,7 +1258,13 @@ loginModal
CodeMirror.commands.indentAuto(editor); CodeMirror.commands.indentAuto(editor);
}, },
Tab: function(editor) { Tab: function(editor) {
var input = $('[data-setting=indentWith]:checked'); if (options.emmet) {
const didEmmetWork = editor.execCommand('emmetExpandAbbreviation');
if (didEmmetWork === true) {
return;
}
}
const input = $('[data-setting=indentWith]:checked');
if ( if (
!editor.somethingSelected() && !editor.somethingSelected() &&
(!input || input.value === 'spaces') (!input || input.value === 'spaces')
@@ -1270,7 +1276,8 @@ loginModal
} else { } else {
CodeMirror.commands.defaultTab(editor); CodeMirror.commands.defaultTab(editor);
} }
} },
'Enter': 'emmetInsertLineBreak'
} }
}); });
cm.on('focus', editor => { cm.on('focus', editor => {
@@ -1335,14 +1342,14 @@ loginModal
profile: 'xhtml', profile: 'xhtml',
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'], gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],
noAutocomplete: true, noAutocomplete: true,
matchTags: { bothTags: true } matchTags: { bothTags: true },
emmet: true
}); });
emmetCodeMirror(scope.cm.html);
scope.cm.css = initEditor(cssCode, { scope.cm.css = initEditor(cssCode, {
mode: 'css', mode: 'css',
gutters: ['error-gutter', 'CodeMirror-linenumbers', 'CodeMirror-foldgutter'] gutters: ['error-gutter', 'CodeMirror-linenumbers', 'CodeMirror-foldgutter'],
emmet: true
}); });
emmetCodeMirror(scope.cm.css);
Inlet(scope.cm.css); Inlet(scope.cm.css);
scope.cm.js = initEditor(jsCode, { scope.cm.js = initEditor(jsCode, {
mode: 'javascript', mode: 'javascript',