File tree 1 file changed +9
-10
lines changed
1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -426,9 +426,10 @@ module View = {
426
426
| Some ("message-input" ) => ()
427
427
| Some ("api-input" ) => ()
428
428
| _ =>
429
- JsUtil . copy(
430
- (cursor. selected_text |> Option . value(~default= () => "" ))() ,
431
- )
429
+ let str =
430
+ (cursor. selected_text |> Option . value(~default= () => "" ))() ;
431
+ Haz3lcore . ClipboardCache . set(cursor. selection, str);
432
+ JsUtil . copy(str);
432
433
};
433
434
| None => ()
434
435
};
@@ -443,9 +444,10 @@ module View = {
443
444
| Some ("message-input" ) => Effect . Ignore
444
445
| Some ("api-input" ) => Effect . Ignore
445
446
| _ =>
446
- JsUtil . copy(
447
- (cursor. selected_text |> Option . value(~default= () => "" ))() ,
448
- );
447
+ let str =
448
+ (cursor. selected_text |> Option . value(~default= () => "" ))() ;
449
+ Haz3lcore . ClipboardCache . set(cursor. selection, str);
450
+ JsUtil . copy(str);
449
451
Option . map(
450
452
inject,
451
453
Selection . handle_key_event(
@@ -478,12 +480,9 @@ module View = {
478
480
| Some ("message-input" ) => Effect . Ignore
479
481
| Some ("api-input" ) => Effect . Ignore
480
482
| _ =>
481
- let pasted_text =
482
- Js . to_string(evt##. clipboardData## getData(Js . string("text" )))
483
- |> Str . global_replace(Str . regexp("\n [ ]*" ), "\n " );
484
483
Dom . preventDefault(evt);
485
484
let action =
486
- pasted_text
485
+ Js . to_string(evt ##. clipboardData ## getData( Js . string( "text" )))
487
486
|> Haz3lcore . ClipboardCache . get
488
487
|> cursor. editor_action;
489
488
switch (action) {
You can’t perform that action at this time.
0 commit comments