Skip to content

Commit

Permalink
fix: only hide active line and gutter line if control is readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
Soc Sieng committed Sep 26, 2020
1 parent fa18dcb commit 76257a5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/AceEditor.ts
Expand Up @@ -97,13 +97,15 @@ class AceEditor extends HTMLElement {
editor.getSession().setTabSize(this.tabSize || 2);
editor.getSession().setUseSoftTabs(!!this.softTabs);

editor.setReadOnly(!!this.readonly);
editor.setHighlightActiveLine(!this.readonly);
editor.setHighlightGutterLine(!this.readonly);

editor.renderer.setShowGutter(!this.hideGutter);
editor.renderer.setShowPrintMargin(!this.hidePrintMargin);

editor.setReadOnly(!!this.readonly);
if (this.readonly) {
editor.setHighlightActiveLine(!this.readonly);
editor.setHighlightGutterLine(!this.readonly);
}

editor.getSession().setUseWrapMode(!!this.wrap);

editor.off('change', this.handleChange);
Expand Down

0 comments on commit 76257a5

Please sign in to comment.