Skip to content

Commit 024e5b0

Browse files
resolves merge conflicts
1 parent 7ae6c87 commit 024e5b0

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/haz3lweb/view/Page.re

+9-10
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,10 @@ module View = {
426426
| Some("message-input") => ()
427427
| Some("api-input") => ()
428428
| _ =>
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);
432433
};
433434
| None => ()
434435
};
@@ -443,9 +444,10 @@ module View = {
443444
| Some("message-input") => Effect.Ignore
444445
| Some("api-input") => Effect.Ignore
445446
| _ =>
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);
449451
Option.map(
450452
inject,
451453
Selection.handle_key_event(
@@ -478,12 +480,9 @@ module View = {
478480
| Some("message-input") => Effect.Ignore
479481
| Some("api-input") => Effect.Ignore
480482
| _ =>
481-
let pasted_text =
482-
Js.to_string(evt##.clipboardData##getData(Js.string("text")))
483-
|> Str.global_replace(Str.regexp("\n[ ]*"), "\n");
484483
Dom.preventDefault(evt);
485484
let action =
486-
pasted_text
485+
Js.to_string(evt##.clipboardData##getData(Js.string("text")))
487486
|> Haz3lcore.ClipboardCache.get
488487
|> cursor.editor_action;
489488
switch (action) {

0 commit comments

Comments
 (0)