Skip to content

Commit

Permalink
readdded highlight of active line but only when focused
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin committed Apr 11, 2014
1 parent 7605674 commit 06ec20c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/assets/javascripts/rails_embed_editor/application.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ setup_editor = (element, options) ->
editor.setAutoScrollEditorIntoView();
editor.setOption("maxLines", 40);
editor.setOption("minLines", 5);

#highlight the current line only if its focus
editor.setHighlightActiveLine(false)
editor.on "focus", () ->
editor.setHighlightActiveLine(true)
editor.on "blur", () ->
editor.setHighlightActiveLine(false)

editor.getSession().addMarker(options['highlight'], "editor_highlight", "text") unless options['highlight'] == null

Expand Down

0 comments on commit 06ec20c

Please sign in to comment.