Created
May 2, 2012 16:09
-
-
Save assertchris/2577836 to your computer and use it in GitHub Desktop.
Highlight lines in Ace (Editor)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
CoffeeScript | |
marker = null; | |
require(["ace/range"], (range) -> | |
marker = editor.getSession().addMarker(new range.Range(7, 0, 7, 2000), "warning", "line", true); | |
) | |
setTimeout(-> | |
editor.getSession().removeMarker(marker) | |
, 3000) | |
### | |
### | |
CSS | |
.warning | |
{ | |
background: rgba(255, 50, 50, 0.1); | |
position: absolute; | |
width: 100% !important; | |
left: 0 !important; | |
} | |
### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
position: absolute is the secret sauce here. Without that you will be left scratching your head.