From 09ae3f5619cc2fa2606b44e581cf2a266ef6fb7e Mon Sep 17 00:00:00 2001 From: life Date: Fri, 25 Dec 2015 11:22:08 +0800 Subject: [PATCH] add line height for ace --- public/js/app/page.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/js/app/page.js b/public/js/app/page.js index 6e1480a3..88101976 100644 --- a/public/js/app/page.js +++ b/public/js/app/page.js @@ -797,7 +797,8 @@ LeaAce = { $pre.removeClass('ace-to-pre'); $pre.attr("contenteditable", false); // ? 避免tinymce编辑 var aceEditor = ace.edit(id); - + + aceEditor.container.style.lineHeight = 1.5; aceEditor.setTheme("ace/theme/tomorrow"); var brush = me.getPreBrush($pre); @@ -808,6 +809,9 @@ LeaAce = { } catch(e) {} } b = b || "javascript"; + if (b == 'false') { + b = 'javascript'; + } aceEditor.session.setMode("ace/mode/" + b); aceEditor.session.setOption("useWorker", false); // 不用语法检查 // retina @@ -817,6 +821,9 @@ LeaAce = { else { aceEditor.setFontSize("14px"); } + + + aceEditor.getSession().setUseWorker(false); // 不用语法检查 aceEditor.setOption("showInvisibles", false); // 不显示空格, 没用 aceEditor.setShowInvisibles(false); // OK 不显示空格 @@ -825,6 +832,7 @@ LeaAce = { aceEditor.setAutoScrollEditorIntoView(true); aceEditor.setReadOnly(Note.readOnly); aceEditor.setOption("maxLines", 10000); + aceEditor.commands.addCommand({ name: "undo", bindKey: {win: "Ctrl-z", mac: "Command-z"},