jxxcarlson / elm-text-editor / Editor.Update

Blah, blah ...


type Msg
    = NoOp
    | MouseDown Position
    | MouseOver Position
    | MouseUp
    | Copy
    | CopyPasteClipboard
    | WriteToSystemClipBoard
    | Cut
    | CursorLeft
    | CursorRight
    | CursorUp
    | CursorDown
    | CursorToLineEnd
    | CursorToLineStart
    | CursorToGroupEnd
    | CursorToGroupStart
    | Insert String
    | FirstLine
    | AcceptLineNumber String
    | AcceptSearchText String
    | AcceptReplacementText String
    | ReplaceCurrentSelection
    | LastLine
    | Paste
    | PasteFromClipboard
    | RemoveCharAfter
    | RemoveCharBefore
    | RemoveGroupAfter
    | RemoveGroupBefore
    | Indent
    | Deindent
    | SelectUp
    | SelectDown
    | SelectLeft
    | SelectRight
    | SelectToLineStart
    | SelectToLineEnd
    | SelectToGroupStart
    | SelectToGroupEnd
    | SelectAll
    | SelectGroup
    | SelectLine
    | SendLine
    | Undo
    | Redo
    | ScrollUp Basics.Int
    | ScrollDown Basics.Int
    | ScrollToSelection (( Position, Position ))
    | RollSearchSelectionForward
    | RollSearchSelectionBackward
    | SyncToSearchHit
    | Clear
    | WrapSelection
    | WrapAll
    | ToggleWrapping
    | ToggleHelp
    | ToggleInfoPanel
    | ToggleGoToLinePanel
    | ToggleSearchPanel
    | ToggleReplacePanel
    | OpenReplaceField
    | DebounceMsg Debounce.Msg
    | Unload String
    | GotViewport (Result Browser.Dom.Error Browser.Dom.Viewport)
    | GotViewportForSync Position (Maybe Position) (Result Browser.Dom.Error Browser.Dom.Viewport)

The messages to which the editor responds

blur : String -> Platform.Cmd.Cmd Msg

A command to lose focus on the element with the given id.

clearState : Editor.Model.InternalState -> Editor.Model.InternalState

Return the "zero"" internal state

focus : String -> Platform.Cmd.Cmd Msg

A command to place the focus on the element with the given id.

scrollToLine : Basics.Int -> Editor.Model.InternalState -> Buffer -> ( Editor.Model.InternalState, Buffer )

Return a pair (InternalState, Buffer) representing the editor scrolled to a given line k.

scrollToText : String -> Editor.Model.InternalState -> Buffer -> ( Editor.Model.InternalState, Buffer )

Return data representing the editor scrolled toa given string (first search occurrence).

update : Buffer -> Msg -> Editor.Model.InternalState -> ( Editor.Model.InternalState, Buffer, Platform.Cmd.Cmd Msg )

Return data representing an editor updated via a message and a new buffer