Open stroomdev10 opened 2 years ago
Look for ace_toggle_wrap
in stroom-core-client-widget/src/main/java/edu/ycp/cs/dh/acegwt/public/ace/ace.js
Seems if the line is over a set length it adds the button which when clicked will toggle the state of wordwrap but this then puts ace out of sync with what Stroom thinks the wrap state is.
this.$renderOverflowMessage = function(parent, screenColumn, token, value, hide) {
token && this.$renderToken(parent, screenColumn, token,
value.slice(0, this.MAX_LINE_LENGTH - screenColumn));
var overflowEl = this.dom.createElement("span");
overflowEl.className = "ace_inline_button ace_keyword ace_toggle_wrap";
overflowEl.textContent = hide ? "<hide>" : "<click to see more...>";
parent.appendChild(overflowEl);
};
...
if (dom.hasCssClass(target, "ace_toggle_wrap")) {
session.setOption("wrap", !session.getUseWrapMode());
editor.renderer.scrollCursorIntoView();
}
When displaying the editor right click menu we may need to ask ace what the wrap state is.
When viewing a large single line source stream, the ACE editor has a clickable
<hide>
button. Pressing the button appears to switch Word Wrap off, but the Wrap state looks messed up.