class Tessell::Kit::TextEditing

Defined in:

tessell/kit/text_editing.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(text : String = "") #

[View source]

Instance Method Detail

def anchor : Int32 | Nil #

[View source]
def backspace : Bool #

[View source]
def boundaries : Array(Int32) #

[View source]
def collapse_selection : Nil #

[View source]
def commit_preedit : Bool #

[View source]
def copy(clipboard : Clipboard) : Bool #

[View source]
def cursor : Int32 #

[View source]
def cut(clipboard : Clipboard) : Bool #

[View source]
def delete : Bool #

[View source]
def insert(value : String) : Bool #

返回 text 是否变化。包含 \t 的插入按 tabs 语义守住(issue #32): Reject 整体拒绝;Insert 把每个 \t 展开为 tab_width 个空格——文本 里永不出现 \t 字形,宽度与光标不依赖字体制表位。


[View source]
def move_end(extending : Bool = false) : Nil #

[View source]
def move_home(extending : Bool = false) : Nil #

[View source]
def move_left(extending : Bool = false) : Nil #

[View source]
def move_right(extending : Bool = false) : Nil #

[View source]
def paste(clipboard : Clipboard) : Bool #

[View source]
def preedit : String #

[View source]
def preedit? : Bool #

[View source]
def select_all : Nil #

[View source]
def selected_text : String #

[View source]
def selection? : Bool #

[View source]
def selection_end : Int32 #

[View source]
def selection_start : Int32 #

[View source]
def set_cursor(position : Int32, extending : Bool = false) : Nil #

[View source]
def set_preedit(value : String) : Nil #

[View source]
def set_text(value : String) : Nil #

[View source]
def tab_width : Int32 #

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

[View source]
def tabs : TabBehavior #

Tab 行为选项(issue #32);tab_width 仅 Insert 生效。


[View source]
def tabs=(tabs : TabBehavior) #

Tab 行为选项(issue #32);tab_width 仅 Insert 生效。


[View source]
def text : String #

[View source]