fix listenning ctrl key from compile and run

pull/2298/head
yann300 3 years ago committed by GitHub
parent 59ba75bc52
commit c7a7ea73ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      apps/remix-ide/src/app/tabs/compile-and-run.ts

@ -26,17 +26,20 @@ export class CompileAndRun extends Plugin {
super(profile)
this.executionListener = async (e) => {
// ctrl+e or command+e
const file = await this.call('fileManager', 'file')
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.keyCode === 83 && file !== '') {
if (file.endsWith('.sol')) {
e.preventDefault()
this.targetFileName = file
await this.call('solidity', 'compile', file)
_paq.push(['trackEvent', 'ScriptExecutor', 'compile_solidity'])
} else if (file.endsWith('.js') || file.endsWith('.ts')) {
e.preventDefault()
this.runScript(file, false)
_paq.push(['trackEvent', 'ScriptExecutor', 'run_script'])
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.keyCode === 83) {
const file = await this.call('fileManager', 'file')
if (file) {
if (file.endsWith('.sol')) {
e.preventDefault()
this.targetFileName = file
await this.call('solidity', 'compile', file)
_paq.push(['trackEvent', 'ScriptExecutor', 'compile_solidity'])
} else if (file.endsWith('.js') || file.endsWith('.ts')) {
e.preventDefault()
this.runScript(file, false)
_paq.push(['trackEvent', 'ScriptExecutor', 'run_script'])
}
}
}
}

Loading…
Cancel
Save