Skip to content

Commit

Permalink
Fix selections printing as buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Negabinary committed Aug 21, 2024
1 parent 13e456c commit 7b39c43
Showing 2 changed files with 7 additions and 27 deletions.
25 changes: 0 additions & 25 deletions src/haz3lweb/app/editors/code/Code.re
Original file line number Diff line number Diff line change
@@ -186,28 +186,3 @@ let of_hole = (~globals: Globals.t, ~measured, g: Grout.t) =>
mold: Mold.of_grout(g, Any),
},
);

let view =
(
~globals: Globals.t,
~sort: Sort.t,
~settings: Settings.t,
~statics: CachedStatics.t,
z: Zipper.t,
{syntax: {measured, segment, holes, selection_ids, _}, _}: Editor.t,
)
: Node.t => {
module Text =
Text({
let map = measured;
let settings = settings;
let info_map = statics.info_map;
});
let buffer_ids = Selection.is_buffer(z.selection) ? selection_ids : [];
let code = Text.of_segment(buffer_ids, false, sort, segment);
let holes = List.map(of_hole(~measured, ~globals), holes);
div(
~attrs=[Attr.class_("code")],
[span_c("code-text", code), ...holes],
);
};
9 changes: 7 additions & 2 deletions src/haz3lweb/app/editors/code/CodeWithStatics.re
Original file line number Diff line number Diff line change
@@ -69,15 +69,20 @@ module View = {
(~globals, ~overlays: list(Node.t)=[], ~sort=Sort.root, model: Model.t) => {
let {
statics: {info_map, _},
editor: {syntax: {measured, selection_ids, segment, holes, _}, _},
editor:
{
syntax: {measured, selection_ids, segment, holes, _},
state: {zipper: z, _},
_,
},
_,
}: Model.t = model;
let code_text_view =
CodeViewable.view(
~globals,
~sort,
~measured,
~buffer_ids=selection_ids,
~buffer_ids=Selection.is_buffer(z.selection) ? selection_ids : [],
~segment,
~holes,
~info_map,

0 comments on commit 7b39c43

Please sign in to comment.