Created
October 24, 2010 09:22
-
-
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
This file contains 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
class EditView | |
def highlight(offset, length, colour) | |
end | |
def clear_all_highlights | |
end | |
def clear_highlights_on_line(line_num) | |
end | |
end |
This file contains 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
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