summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewscript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rw-r--r--indra/newview/llpreviewscript.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index bd1f68da33..b3e53df6d8 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -1113,11 +1113,11 @@ void LLScriptEdCore::doSave( bool close_after_save )
void LLScriptEdCore::openInExternalEditor()
{
- if (mContainer->mLiveFile)
- {
- // If already open in an external editor, just return
- return;
- }
+ //if (mContainer->mLiveFile)
+ //{
+ // // If already open in an external editor, just return
+ // return;
+ //}
// Generate a suitable filename
std::string script_name = mScriptName;
@@ -1141,9 +1141,17 @@ void LLScriptEdCore::openInExternalEditor()
writeToFile(filename);
}
+ if (mContainer->mLiveFile && mContainer->mLiveFile->filename() != filename)
+ { // The name may have changed if we changed the type of scipt being edited.
+ delete mContainer->mLiveFile;
+ mContainer->mLiveFile = NULL;
+ }
// Start watching file changes.
- mContainer->mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLScriptEdContainer::onExternalChange, mContainer, _1));
- mContainer->mLiveFile->addToEventTimer();
+ if (!mContainer->mLiveFile)
+ {
+ mContainer->mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLScriptEdContainer::onExternalChange, mContainer, _1));
+ mContainer->mLiveFile->addToEventTimer();
+ }
mContainer->startWebsocketServer();
// Open it in external editor.