Skip to content
Snippets Groups Projects
Commit 1a185ff5 authored by David Bühler's avatar David Bühler
Browse files

[ivette] Minor simplifications.

parent c9d7561a
No related branches found
No related tags found
No related merge requests found
......@@ -269,8 +269,8 @@ function openFilter(
filter: string,
onChange: (f: string) => void,
): void {
const fs = filter.split(':');
const menuItems = infos.map((info) => {
const fs = filter.split(':');
const checked = !fs.some((m) => m === info.id);
const onClick = (): void => {
const newFs =
......
......@@ -53,17 +53,15 @@ export function printTextWithTags(
options?: DomeBuffers.MarkerProps,
): void {
if (Array.isArray(text)) {
let marker = false;
const tag = text[0];
if (typeof (tag) === 'string') {
const marker = typeof (tag) === 'string';
if (marker) {
buffer.openTextMarker({ id: tag, ...options ?? {} });
marker = true;
}
for (let k = marker ? 1 : 0; k < text.length; k++) {
printTextWithTags(buffer, text[k], options);
}
if (marker) {
marker = false;
buffer.closeTextMarker();
}
} else if (typeof text === 'string') {
......
......@@ -72,12 +72,11 @@ sig
Registers a marker information printer.
Identifier [id] shall be unique.
Label [label] shall be very short.
Description shall succintly describe the kind of information.
Description shall succinctly describe the kind of information.
If the optional [enable] function is provided, the information printer is
only used when [enable ()] returns true.
The printer is allowed to raise [Not_found] exception,
which is interpreted as there is no information of this kind for
the localizable.
The printer is allowed to raise [Not_found] exception when there is no
information for the localizable.
*)
val register :
id:string -> label:string -> title:string -> ?enable:(unit -> bool) ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment