For an application I am developing I would like to have strict control over the annotations of a CodeEditor object. I seems that with the new minor release (v1.7.0), the internal code editors annotations take precedence over the set annotations.
Example videos showcasing the annotations behaviour between two panel versions:
Is there a way to disable this overwriting of annotations? Thanks!
The following minimal example was used in the videos above:
import panel as pn
pn.extension("codeeditor")
code = """test:
- {a: 1, b: 2}
- {c: 3, d: 4}
- {e: 5, f: 6}
"""
editor = pn.widgets.CodeEditor(
value=code,
language="yaml",
width=300,
annotations=[],
)
def add_annotations(event):
editor.annotations = [
{"row": 1, "column": 0, "text": "a warning", "type": "warning"},
{"row": 2, "column": 0, "text": "an error", "type": "error"},
]
button = pn.widgets.Button(name="Add Annotations")
button.on_click(add_annotations)
pn.Row(editor, button).servable()