class
Opal::UI::CodeView
- Opal::UI::CodeView
- Opal::UI::Element
- Reference
- Object
Overview
Code and disassembly viewing element with line numbers, syntax highlighting, cursor indicator, and vertical scrolling.
Defined in:
opal/ui/components/code_view.crConstructors
Instance Method Summary
- #code : String
- #code=(code : String)
- #cursor_fg : Color
- #cursor_fg=(cursor_fg : Color)
- #cursor_indicator : String
- #cursor_indicator=(cursor_indicator : String)
- #gutter_fg : Color
- #gutter_fg=(gutter_fg : Color)
- #highlighted_line : Int32 | Nil
- #highlighted_line=(highlighted_line : Int32 | Nil)
- #language : Symbol
- #language=(language : Symbol)
- #lines : Array(String)
- #preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
- #render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
- #scroll_down(count : Int32 = 1) : Nil
- #scroll_offset : Int32
- #scroll_offset=(scroll_offset : Int32)
- #scroll_up(count : Int32 = 1) : Nil
- #show_line_numbers=(show_line_numbers : Bool)
- #show_line_numbers? : Bool
- #start_line : Int32
- #start_line=(start_line : Int32)
Instance methods inherited from class Opal::UI::Element
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
preferred_size,
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
render
Constructor Detail
def self.new(code : String = "", language : Symbol = :plain, start_line : Int32 = 1, highlighted_line : Int32 | Nil = nil, scroll_offset : Int32 = 0, show_line_numbers : Bool = true, gutter_fg : Color | Symbol | String = :dark_gray, cursor_fg : Color | Symbol | String = :yellow, cursor_indicator : String = "▶ ")
#