From 0c86f5718e2b4c4620e7af9f169250daceefa9c5 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sun, 3 May 2015 18:30:22 +0100 Subject: [PATCH] Now establishing line number and goto on open --- lib/file-control-xhr.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/file-control-xhr.php b/lib/file-control-xhr.php index 71abdf3..89ec63d 100644 --- a/lib/file-control-xhr.php +++ b/lib/file-control-xhr.php @@ -541,6 +541,7 @@ if (!$error && $_GET['action']=="replaceText") { // ========================== if (!$error && $_GET['action']=="getRemoteFile") { + $lineNumber = max(isset($_REQUEST['lineNumber'])?intval($_REQUEST['lineNumber']):1, 1); $doNext = ""; if ($remoteFile = toUTF8noBOM(file_get_contents($file,false,$context),true)) { // replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding @@ -549,6 +550,7 @@ if (!$error && $_GET['action']=="getRemoteFile") { $remoteFile = str_replace("\n", $ICEcoder["lineEnding"], $remoteFile); $doNext .= 'top.ICEcoder.newTab();'; $doNext .= 'top.ICEcoder.getcMInstance().setValue(\''.str_replace("\r","",str_replace("\t","\\\\t",str_replace("\n","\\\\n",str_replace("'","\\\\'",str_replace("\\","\\\\",preg_quote($remoteFile)))))).'\');'; + $doNext .= 'top.ICEcoder.goToLine('.$lineNumber.');'; $finalAction = "getRemoteFile"; // Run our custom processes include_once("../processes/on-get-remote-file.php");