Now establishing line number and goto on open

This commit is contained in:
Matt Pass
2015-05-03 18:30:22 +01:00
parent 53e0252afc
commit 0c86f5718e

View File

@@ -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");