nano-ui
Safe HaskellNone
LanguageGHC2024

NanoUI.Widgets.TextCommand

Description

The commands text fields run: the same ones for keys, context menus and app code.

Synopsis

Documentation

data TextCommand Source #

Something done to a text field. Commands that change text are undoable and replace the selection where one exists.

Constructors

InsertText !Text

Replace the selection with text (typing, a snippet).

Delete !TextMotion

Delete the selection, or from the cursor to where the motion lands: Delete CharLeft is Backspace, Delete WordRight Ctrl+Delete.

Move !TextMotion !Bool

Move the cursor, extending the selection when the flag is set.

SelectAll 
Select !Cursor !Cursor

Select from the first position (the anchor) to the second (the cursor), clamped into the document.

Replace !Cursor !Cursor !Text

Replace the text between two positions, leaving the cursor after it.

ReplaceAll !Text

Replace the whole document as one undoable edit.

Undo 
Redo 
Cut 
Copy 
Paste 

Instances

Instances details
Eq TextCommand Source # 
Instance details

Defined in NanoUI.Widgets.TextCommand

Show TextCommand Source # 
Instance details

Defined in NanoUI.Widgets.TextCommand