@@ -577,32 +577,38 @@ on revIDEDeveloperExtensionUninstall pPath
577577end revIDEDeveloperExtensionUninstall
578578
579579on revIDEDeveloperExtensionEditScript pFolder
580- local tFile
580+ local tFile , tResult
581581 put pFolder & slash & __revIDEDeveloperExtensionFetchModuleInFolder(pFolder ) into tFile
582582
583583 # AL-2015-04-01: [[ Bug 15130 ]] First check to see if there is an existing association
584584 launch document tFile
585- if the result is not empty then
585+ put the result into tResult
586+ if tResult is not empty then
586587 # AL-2015-04-01: [[ Bug 15130 ]] Check to see if the text editor preference is set
587588 local tEditor
588589 put revIDEGetPreference("LCB_textEditor" ) into tEditor
589590 if tEditor is not empty then
590591 launch tFile with tEditor
592+ put the result into tResult
591593 end if
592594 end if
593595
594- if the result is "no association" or the result is "request failed" then
596+ if tResult is "no association" or tResult is "request failed" \
597+ or tResult is "no such program" then
595598 answer file "Select text editor..."
596- if it is not empty then
597- launch tFile with it
599+ put it into tEditor
600+ if tEditor is not empty then
601+ launch tFile with tEditor
602+ put the result into tResult
603+ if tResult is empty then
604+ # AL-2015-04-01: [[ Bug 15130 ]] If the new text editor launch was successful, set the preference
605+ revIDESetPreference "LCB_textEditor" , tEditor
606+ end if
598607 end if
599608 end if
600609
601- if the result is not empty then
602- __revIDEDeveloperExtensionSendError "Could not open" && tFile & ":" && the result
603- else if it is not empty then
604- # AL-2015-04-01: [[ Bug 15130 ]] If the new text editor launch was successful, set the preference
605- revIDESetPreference "LCB_textEditor" , it
610+ if tResult is not empty and tResult is not tEditor then
611+ __revIDEDeveloperExtensionSendError "Could not open" && tFile & ":" && tResult
606612 end if
607613end revIDEDeveloperExtensionEditScript
608614
0 commit comments