package core:text/edit
⌘K
Ctrl+K
or
/
Index
Types (5)
Constants (2)
Variables (0)
This section is empty.
Procedure Groups (0)
This section is empty.
Types
Command ¶
Command :: enum u32 { None, Undo, Redo, New_Line, // multi-lines Cut, Copy, Paste, Select_All, Backspace, Delete, Delete_Word_Left, Delete_Word_Right, Left, Right, Up, // multi-lines Down, // multi-lines Word_Left, Word_Right, Start, End, Line_Start, Line_End, Select_Left, Select_Right, Select_Up, // multi-lines Select_Down, // multi-lines Select_Word_Left, Select_Word_Right, Select_Start, Select_End, Select_Line_Start, Select_Line_End, }
Related Procedures With Parameters
State ¶
State :: struct { selection: [2]int, line_start, line_end: int, // initialized each "frame" with `begin` builder: ^strings.Builder, // let the caller store the text buffer data up_index, down_index: int, // undo undo: [dynamic]^Undo_State, redo: [dynamic]^Undo_State, undo_text_allocator: runtime.Allocator, id: u64, // Timeout information current_time: time.Tick, last_edit_time: time.Tick, undo_timeout: time.Duration, // Set these if you want cut/copy/paste functionality set_clipboard: proc(user_data: rawptr, text: string) -> (ok: bool), get_clipboard: proc(user_data: rawptr) -> (text: string, ok: bool), clipboard_user_data: rawptr, }
Related Procedures With Parameters
Translation ¶
Translation :: enum u32 { Start, End, Left, Right, Up, Down, Word_Left, Word_Right, Word_Start, Word_End, Soft_Line_Start, Soft_Line_End, }
Related Procedures With Parameters
Constants
DEFAULT_UNDO_TIMEOUT ¶
DEFAULT_UNDO_TIMEOUT: time.Duration : 300 * time.Millisecond
MULTILINE_COMMANDS ¶
MULTILINE_COMMANDS :: Command_Set{.New_Line, .Up, .Down, .Select_Up, .Select_Down}
Variables
This section is empty.
Procedures
begin ¶
Call at the beginning of each frame
delete_to ¶
delete_to :: proc(s: ^State, t: Translation) {…}
move_to ¶
move_to :: proc(s: ^State, t: Translation) {…}
select_to ¶
select_to :: proc(s: ^State, t: Translation) {…}
selection_delete ¶
selection_delete :: proc(s: ^State) {…}
translate_position ¶
translate_position :: proc(s: ^State, pos: int, t: Translation) -> int {…}
undo ¶
undo :: proc(s: ^State, undo, redo: ^[dynamic]^Undo_State) {…}
undo_check ¶
undo_check :: proc(s: ^State) {…}
undo_clear ¶
undo_clear :: proc(s: ^State, undo: ^[dynamic]^Undo_State) {…}
undo_state_push ¶
undo_state_push :: proc(s: ^State, undo: ^[dynamic]^Undo_State) -> runtime.Allocator_Error {…}
Procedure Groups
This section is empty.
Source Files
Generation Information
Generated with odin version dev-2023-10 (vendor "odin") Windows_amd64 @ 2023-10-03 21:09:46.938592600 +0000 UTC