From dd19c39cf8306cc7603663da4d16e8708481da76 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Thu, 27 Dec 2012 14:33:07 +0000 Subject: [PATCH] Declaring function vars and adjusting var name Establishing vars at beginning of function to stop them being globals lineNo2 now lineCount --- lib/ice-coder.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 2986b5c..1e392ec 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1844,8 +1844,9 @@ var ICEcoder = { else if (key==46) {top.ICEcoder.delKeyDown = false} }, + // Add snippet panel below line addSnippet: function() { - var cM; + var cM, lineNo, whiteSpace, content; if (top.ICEcoder.snippetLine!==false) { top.ICEcoder.removeSnippet(); @@ -1869,8 +1870,9 @@ var ICEcoder = { } }, + // Action a snippet doSnippet: function(tgtString,replaceString) { - var cM, lineNo, lineContents, replacedLine; + var cM, lineNo, lineContents, remainder, strPos, replacedLine, whiteSpace, curPos, sPos, lineNoCount; cM = top.ICEcoder.getcMInstance(); lineNo = cM.getCursor().line; @@ -1887,20 +1889,21 @@ var ICEcoder = { replacedLine += replaceString; curPos = replacedLine.indexOf("CURSOR"); sPos = 0; - lineNo2 = lineNo; + lineNoCount = lineNo; for (i=0;i