Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 9a63f32

Browse files
committed
Fix initial setting of LCB editor pref
The following command sequence (in message box): `put revIDEGetPreference("LCB_textEditor") into tEditor; launch ".../treeviewx.lcb" with tEditor; put the result` Results in the value of `tEditor` when successful (although success in opening the file is not guaranteed) Added a check for "no such program" in the case where the specified editor is no longer available Updated code to use the `tEditor` variable in place of `it` for clarity Added a check for `tResult` being `tEditor` to not display an error
1 parent 30b763a commit 9a63f32

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Toolset/libraries/revidedeveloperextensionlibrary.livecodescript

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -593,19 +593,21 @@ on revIDEDeveloperExtensionEditScript pFolder
593593
end if
594594
end if
595595

596-
if tResult is "no association" or tResult is "request failed" then
596+
if tResult is "no association" or tResult is "request failed" \
597+
or tResult is "no such program" then
597598
answer file "Select text editor..."
598-
if it is not empty then
599-
launch tFile with it
599+
put it into tEditor
600+
if tEditor is not empty then
601+
launch tFile with tEditor
600602
put the result into tResult
601603
if tResult is empty then
602604
# AL-2015-04-01: [[ Bug 15130 ]] If the new text editor launch was successful, set the preference
603-
revIDESetPreference "LCB_textEditor", it
605+
revIDESetPreference "LCB_textEditor", tEditor
604606
end if
605607
end if
606608
end if
607609

608-
if tResult is not empty then
610+
if tResult is not empty and tResult is not tEditor then
609611
__revIDEDeveloperExtensionSendError "Could not open" && tFile & ":" && tResult
610612
end if
611613
end revIDEDeveloperExtensionEditScript

0 commit comments

Comments
 (0)