Skip to content

Instantly share code, notes, and snippets.

@danlucraft
Created October 24, 2010 09:22
Show Gist options
  • Save danlucraft/643370 to your computer and use it in GitHub Desktop.
Save danlucraft/643370 to your computer and use it in GitHub Desktop.
Let's try and figure out what a highlighting API could look like
class EditView
def highlight(offset, length, colour)
end
def clear_all_highlights
end
def clear_highlights_on_line(line_num)
end
end
class EditView
# returns a highlight object
def create_highlight(offset, length, colour, transient=false)
end
# returns an array of all currently visible highlight objects
def highlights
end
end
class Highlight
attr_reader :offset, :length, :colour
# removes this highlight from the editview
def remove
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment