Skip to content

Instantly share code, notes, and snippets.

@assertchris
Created May 2, 2012 16:09
Show Gist options
  • Save assertchris/2577836 to your computer and use it in GitHub Desktop.
Save assertchris/2577836 to your computer and use it in GitHub Desktop.
Highlight lines in Ace (Editor)
###
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;
}
###
@kargirwar
Copy link

position: absolute is the secret sauce here. Without that you will be left scratching your head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment