[WIP] wrapping issues

fixes https://github.com/ajaxorg/ace/issues/1186 and  https://github.com/ajaxorg/ace/issues/993