From f789742434c92ede5abf6928a5c8d3b029ee2369 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 12 Dec 2014 00:11:35 +0800 Subject: [PATCH] Fix #176 :last_quarter_moon_with_face: --- static/js/editors.js | 11 +++++++++-- views/index.html | 34 ++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/static/js/editors.js b/static/js/editors.js index 897ac22..40a8b61 100644 --- a/static/js/editors.js +++ b/static/js/editors.js @@ -22,7 +22,7 @@ var editors = { if (editors.data[i].editor.options.path === path) { return editors.data[i].editor; } - } + } }, close: function () { $(".edit-panel .tabs > div[data-index=" + $(".edit-panel .frame").data("index") + "]").find(".ico-close").click(); @@ -613,6 +613,12 @@ var editors = { } }); }; + + CodeMirror.commands.selectIdentifier = function (cm) { + var cur = cm.getCursor(); + var word = cm.findWordAt(cur); + cm.extendSelection(word.anchor, word.head); + }; }, appendSearch: function (data, type, key) { var searcHTML = '