diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 4771e1e..6e1aaa8 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1398,7 +1398,7 @@ var ICEcoder = { newLI = document.createElement("li"); newLI.className = cssStyle; newLI.draggable = true; - newLI.ondrag = function(event) {top.ICEcoder.draggingWithKeyTest(event);if(top.ICEcoder.getcMInstance()){top.ICEcoder.getcMInstance().focus()}}; + newLI.ondrag = function(event) {top.ICEcoder.draggingWithKeyTest(event);if(top.ICEcoder.getcMInstance()){top.ICEcoder.editorFocusInstance.indexOf('diff') == -1 ? top.ICEcoder.getcMInstance().focus() : top.ICEcoder.getcMdiffInstance().focus()}}; newLI.ondragend = function() {top.ICEcoder.dropFile(this)}; newLI.innerHTML = innerLI locNest.nextSibling.appendChild(newLI); @@ -1419,7 +1419,7 @@ var ICEcoder = { newLI = document.createElement("li"); newLI.className = cssStyle; newLI.draggable = true; - newLI.ondrag = function(event) {top.ICEcoder.draggingWithKeyTest(event);if(top.ICEcoder.getcMInstance()){top.ICEcoder.getcMInstance().focus()}}; + newLI.ondrag = function(event) {top.ICEcoder.draggingWithKeyTest(event);if(top.ICEcoder.getcMInstance()){top.ICEcoder.editorFocusInstance.indexOf('diff') == -1 ? top.ICEcoder.getcMInstance().focus() : top.ICEcoder.getcMdiffInstance().focus()}}; newLI.ondragend = function() {top.ICEcoder.dropFile(this)}; newLI.innerHTML = innerLI; // Append or insert depending on which of the above if statements is true @@ -2983,7 +2983,7 @@ var ICEcoder = { // Detect keys/combos plus identify our area and set the vars, perform actions interceptKeys: function(area, evt) { - var key; + var key, cM, cMdiff, thisCM; key = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode; @@ -3130,10 +3130,12 @@ var ICEcoder = { // CTRL + . (Fold/unfold current line) } else if(key==190 && (evt.ctrlKey||top.ICEcoder.cmdKey)) { - var cM = ICEcoder.getcMInstance(); - var line = cM.getCursor().line; - cM.getLine(line).indexOf("{")>-1 - ? top.contentFrame.codeFoldBrace(cM, line) : top.contentFrame.codeFoldTag(cM, line); + cM = ICEcoder.getcMInstance(); + cMdiff = ICEcoder.getcMdiffInstance(); + thisCM = top.ICEcoder.editorFocusInstance.indexOf('diff') > -1 ? cMdiff : cM; + var line = thisCM.getCursor().line; + top.contentFrame.CodeMirror.doFold(thisCM.getLine(line).indexOf("{")>-1 ? "brace" : "xml",null,"+","-",false)(thisCM, line); + return false; // ESC in content area (Comment/Uncomment line)