-
Notifications
You must be signed in to change notification settings - Fork 173
Description
Description
We are using ngx-monaco-editor and visually hiding inline portions of text
using Monaco decorations (inlineClassName) combined with CSS
(e.g. width: 0, font-size: 0, etc.).
While the inline text is visually hidden, wordWrap still behaves as if the
original text were fully visible.
Observed behavior
- Inline text can be visually hidden using decorations and CSS
- Cursor positioning issues caused by this can be mitigated using
disableMonospaceOptimizations: true - However, wordWrap does not change
- Lines are wrapped as if the hidden text were still present in full
Forcing layout recalculation (editor.layout()), toggling wordWrap,
or changing fontSize does not affect wrapping behavior.
Question / clarification
Is this expected behavior?
More specifically:
Is
wordWrapalways computed from the Monaco model text value,
independently of decorations and visually hidden content in the rendered view?
If this is a known limitation or by-design behavior of Monaco Editor,
it would be helpful to confirm or document it explicitly, so users know that
visually hiding inline text via decorations is not sufficient to affect wrapping.
Why this matters
Without this clarification, it is unclear whether this behavior is:
- a limitation of the wrapper
- a limitation of Monaco Editor itself
- or an unsupported use case
This information is important to decide whether inline hiding requires
modifying the model text (e.g. replacing hidden ranges with placeholders)
instead of relying on decorations alone.
Environment
- Angular 20.3.2
- ngx-monaco-editor 20.3.0
- Monaco Editor "^0.52.2",
wordWrap: "on"