diff --git a/app/views/tree/edit.html.haml b/app/views/tree/edit.html.haml index 638958e..d1d7bf8 100644 --- a/app/views/tree/edit.html.haml +++ b/app/views/tree/edit.html.haml @@ -19,8 +19,11 @@ = link_to "Cancel", project_tree_path(@project, @id), class: "btn cancel-btn", confirm: "Are you sure?" :javascript + var ace_mode = "#{@tree.language.try(:ace_mode)}"; var editor = ace.edit("editor"); - editor.getSession().setMode("ace/mode/javascript"); + if (ace_mode) { + editor.getSession().setMode('ace/mode/' + ace_mode); + } $(".save-btn").click(function(){ $("#file_content").val(editor.getValue()); -- libgit2 0.21.2