File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ foreign import javascript unsafe "$1.value"
3030foreign import javascript unsafe " $1.value = $2"
3131 js_input_set_value :: JSVal -> JSString -> IO ()
3232
33+ foreign import javascript unsafe " $1.select()"
34+ js_input_select :: JSVal -> IO ()
35+
3336foreign import javascript unsafe " $1.key"
3437 js_event_key :: JSVal -> IO JSString
3538
@@ -83,6 +86,11 @@ clearREPL = do
8386 exprIn <- js_document_getElementById (toJSString " expr" )
8487 js_input_set_value exprIn (toJSString " " )
8588
89+ selectREPL :: IO ()
90+ selectREPL = do
91+ exprIn <- js_document_getElementById (toJSString " expr" )
92+ js_input_select exprIn
93+
8694-- | Handle evaluation request.
8795handleEval :: RefState -> IO ()
8896handleEval ref = do
@@ -98,7 +106,7 @@ handleEval ref = do
98106 result <- eval ref expr
99107 logHistory result
100108
101- clearREPL
109+ selectREPL
102110
103111-- | Put an item in the interpreter history.
104112logHistory :: String -> IO ()
You can’t perform that action at this time.
0 commit comments