diff --git a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx
index 87481a2ae6..53305de37a 100644
--- a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx
+++ b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx
@@ -152,7 +152,7 @@ export const TabsUI = (props: TabsUIProps) => {
if (ext) return ext[0].toLowerCase()
else return ''
}
-
+ const path = active().substr(active().indexOf('/') + 1, active().length)
return (
@@ -161,8 +161,7 @@ export const TabsUI = (props: TabsUIProps) => {
data-id='play-editor'
className="btn text-success py-0"
disabled={!(tabsState.currentExt === 'js' || tabsState.currentExt === 'ts' || tabsState.currentExt === 'sol')}
- onClick={async () => {
- const path = active().substr(active().indexOf('/') + 1, active().length)
+ onClick={async () => {
const content = await props.plugin.call('fileManager', "readFile", path)
if (tabsState.currentExt === 'js' || tabsState.currentExt === 'ts') {
await props.plugin.call('scriptRunner', 'execute', content, path)
@@ -181,6 +180,7 @@ export const TabsUI = (props: TabsUIProps) => {
tooltipId="overlay-tooltip-run-script"
tooltipText={
{(tabsState.currentExt === 'js' || tabsState.currentExt === 'ts') ? "Run script (CTRL + SHIFT + S)" :
+ (path.endsWith('.script.sol')) ? "Run Solidity code as a script (free function)" :
tabsState.currentExt === 'sol' || tabsState.currentExt === 'yul'? "Compile CTRL + S" : "Select .sol or .yul file to compile or a .ts or .js file and run it"}
}
>