Ace: Is there a way to disable indented wrapping in mode-html and derived modes?

Created on 14 Jul 2015  ·  5Comments  ·  Source: ajaxorg/ace

When editing text in HTML mode and setting text wrapping on, I get the text to wrap, but it wraps with an indent rather than wrapping to the left edge margin.

Is there any way to disable that behavior? I'd like to have text wrapping behave 'normal' and wrap all the way to the left.

Is this possible with a switch? If not, what code has to be adjusted to make this happen? I'm using a derived custom mode so changing the code would be isolated anyway.

Most helpful comment

It can be disabled with editor.session.setOption("indentedSoftWrap", false)
Perhaps we should have kept indentedSoftWrap off by default since it seems to produce bad results in some cases (e.g for narrow multiline textbox in c9.io chat)

All 5 comments

It can be disabled with editor.session.setOption("indentedSoftWrap", false)
Perhaps we should have kept indentedSoftWrap off by default since it seems to produce bad results in some cases (e.g for narrow multiline textbox in c9.io chat)

Is it only me, or does this setting only apply after you type something/resize the window.

When the editor mounts everything is still indented.

@fiws https://github.com/ajaxorg/ace/pull/3641 will fix the issue with view not being updated automatically, thanks for reporting

@nightwing Is there a release schedule something like that? I would like to remove my ugly workaround for this. (No pressure)

@fivs - you can force the window to resize from code if necessary:

editor.resize(true); //force a redraw 

There seem to be a few settings that require this to take properly.

Was this page helpful?
0 / 5 - 0 ratings