diff --git a/ivette/src/frama-c/kernel/ASTinfo.tsx b/ivette/src/frama-c/kernel/ASTinfo.tsx index e03a21f7b2dad6c6dd482677e9324147b930af37..e538e0426276f0779811b323ba19780c948d671f 100644 --- a/ivette/src/frama-c/kernel/ASTinfo.tsx +++ b/ivette/src/frama-c/kernel/ASTinfo.tsx @@ -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 = diff --git a/ivette/src/frama-c/richtext.tsx b/ivette/src/frama-c/richtext.tsx index de36f8f01b24b451ee042930a0735c67c5e3c69f..3a9c72c6c7c428f0a7906744e1a886a99aec61d8 100644 --- a/ivette/src/frama-c/richtext.tsx +++ b/ivette/src/frama-c/richtext.tsx @@ -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') { diff --git a/src/plugins/server/kernel_ast.mli b/src/plugins/server/kernel_ast.mli index a859ea128116a36e7f9312508939510d95e2a715..e18092b2f9e96a5852c5a91f7789f47f33d53112 100644 --- a/src/plugins/server/kernel_ast.mli +++ b/src/plugins/server/kernel_ast.mli @@ -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) ->