glirc-2.22: Console IRC client

Copyright(c) Eric Mertens 2016
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Client.State.EditBox.Content

Contents

Description

This module manages simple text navigation and manipulation, but leaves more complicated operations like yank/kill and history management to Client.State.EditBox

Synopsis

Multiple lines

data Content Source #

Zipper-ish view of the multi-line content of an EditBox. Lines above the currentLine are stored in reverse order.

noContent :: Content Source #

Default Content value

shift :: Content -> (String, Content) Source #

Shifts the first line off of the Content, yielding the text of the line and the rest of the content.

Focused line

Movements

left :: Content -> Content Source #

Move the cursor left, across lines if necessary.

right :: Content -> Content Source #

Move the cursor right, across lines if necessary.

leftWord :: Content -> Content Source #

Move the cursor left to the previous word boundary.

rightWord :: Content -> Content Source #

Move the cursor right to the next word boundary.

jumpLeft :: Content -> Content Source #

When at beginning of line, jump to beginning of previous line. Otherwise jump to beginning of current line.

jumpRight :: Content -> Content Source #

When at end of line, jump to end of next line. Otherwise jump to end of current line.

Edits

delete :: Content -> Content Source #

Delete the character after/under the cursor.

backspace :: Content -> Content Source #

Delete the character before the cursor.

insertPastedString :: String -> Content -> Content Source #

Smarter version of insertString that removes spurious newlines.

insertString :: String -> Content -> Content Source #

Insert string at cursor, cursor is advanced to the end of the inserted string.

insertChar :: Char -> Content -> Content Source #

Insert character at cursor, cursor is advanced.

digraph :: Content -> Maybe Content Source #

Use the two characters preceeding the cursor as a digraph and replace them with the corresponding character.