Skip to content

Commit 9a845f9

Browse files
committed
Fixed minor bugs
1 parent df33c3c commit 9a845f9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

aceeditor/src/main/java/com/susmit/aceeditor/AceEditor.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public void setText(String text)
346346

347347
public void setFontSize(int fontSizeInpx)
348348
{
349-
loadUrl("document.getElementById('editor').style.fontSize='" + String.valueOf(fontSizeInpx) + "px';");
349+
loadUrl("javascript:document.getElementById('editor').style.fontSize='" + String.valueOf(fontSizeInpx) + "px';");
350350
}
351351

352352
public void insertTextAtCursor(String text)
@@ -447,6 +447,14 @@ public void endFind()
447447
findString = null;
448448
}
449449

450+
public void setSoftWrap(boolean enabled)
451+
{
452+
if(enabled)
453+
loadUrl("javascript:editor.getSession().setUseWrapMode(true);");
454+
else
455+
loadUrl("javascript:editor.getSession().setUseWrapMode(false);");
456+
}
457+
450458
public void setTheme(Theme theme)
451459
{
452460
loadUrl("javascript:editor.setTheme(\"ace/theme/" + theme.name().toLowerCase() + "\");");

0 commit comments

Comments
 (0)