class Opal::UI::CodeView

Overview

Code and disassembly viewing element with line numbers, syntax highlighting, cursor indicator, and vertical scrolling.

Defined in:

opal/ui/components/code_view.cr

Constructors

Instance Method Summary

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 = "▶ ") #

[View source]

Instance Method Detail

def code : String #

[View source]
def code=(code : String) #

[View source]
def cursor_fg : Color #

[View source]
def cursor_fg=(cursor_fg : Color) #

[View source]
def cursor_indicator : String #

[View source]
def cursor_indicator=(cursor_indicator : String) #

[View source]
def gutter_fg : Color #

[View source]
def gutter_fg=(gutter_fg : Color) #

[View source]
def highlighted_line : Int32 | Nil #

[View source]
def highlighted_line=(highlighted_line : Int32 | Nil) #

[View source]
def language : Symbol #

[View source]
def language=(language : Symbol) #

[View source]
def lines : Array(String) #

[View source]
def preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32) #

[View source]
def render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil #

[View source]
def scroll_down(count : Int32 = 1) : Nil #

[View source]
def scroll_offset : Int32 #

[View source]
def scroll_offset=(scroll_offset : Int32) #

[View source]
def scroll_up(count : Int32 = 1) : Nil #

[View source]
def show_line_numbers=(show_line_numbers : Bool) #

[View source]
def show_line_numbers? : Bool #

[View source]
def start_line : Int32 #

[View source]
def start_line=(start_line : Int32) #

[View source]