diff --git a/src/cmd.js b/src/cmd.js index b643c9e..dc62c61 100644 --- a/src/cmd.js +++ b/src/cmd.js @@ -255,6 +255,10 @@ const external_imports_loaded = ( } } +// TODO refactor, make index controlled property and get it from state instead +// of setting to zero +const rerun_code = state => run_code(state, 0) + const input = (state, code, index) => { const files = {...state.files, [state.current_module]: code} const next = run_code({...state, files}, index, [state.current_module]) @@ -785,6 +789,7 @@ export const get_initial_state = state => { export const COMMANDS = { input, + rerun_code, load_dir, create_file, step_into, diff --git a/src/index.js b/src/index.js index d5fdd56..69cb806 100644 --- a/src/index.js +++ b/src/index.js @@ -26,6 +26,7 @@ export const open_run_window = () => { globalThis.run_window.close() } globalThis.run_window = open('about:blank') + exec('rerun_code') } const read_modules = async () => {