glirc-2.39.0.1: Console IRC client
Copyright(c) Eric Mertens 2016
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Client.State.EditBox

Description

This module provides support for the text operations important for providing a text input in the IRC client. It tracks user input history, tab completion history, and provides many update operations which are mapped to the keyboard in Client.EventLoop.

Synopsis

Edit box type

Line type

data Line Source #

Constructors

Line !Int !String 

Instances

Instances details
Read Line Source # 
Instance details

Defined in Client.State.EditBox.Content

Show Line Source # 
Instance details

Defined in Client.State.EditBox.Content

Methods

showsPrec :: Int -> Line -> ShowS #

show :: Line -> String #

showList :: [Line] -> ShowS #

HasLine Line Source # 
Instance details

Defined in Client.State.EditBox.Content

Content type

data Content Source #

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

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.

Operations

delete :: Content -> Content Source #

Delete the character after/under the cursor.

backspace :: Content -> Content Source #

Delete the character before the cursor.

home :: EditBox -> EditBox Source #

Jump the cursor to the beginning of the input.

end :: EditBox -> EditBox Source #

Jump the cursor to the end of the input.

killHome :: EditBox -> EditBox Source #

Delete all text from the cursor to the beginning and store it in the yank buffer.

killEnd :: EditBox -> EditBox Source #

Delete all text from the cursor to the end and store it in the yank buffer.

killWordBackward Source #

Arguments

:: (Char -> Bool) 
-> Bool

yank

-> EditBox 
-> EditBox 

Kill the content from the cursor back to the previous word boundary. When yank is set the yank buffer will be updated.

killWordForward Source #

Arguments

:: (Char -> Bool) 
-> Bool

yank

-> EditBox 
-> EditBox 

Kill the content from the curser forward to the next word boundary. When yank is set the yank buffer will be updated

yank :: EditBox -> EditBox Source #

Insert the yank buffer at the cursor.

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.

insert :: Char -> EditBox -> EditBox Source #

Insert a character at the cursor and advance the cursor.

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

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

earlier :: EditBox -> Maybe EditBox Source #

Update the editbox to reflect the earlier element in the history.

later :: EditBox -> Maybe EditBox Source #

Update the editbox to reflect the later element in the history.

success :: EditBox -> EditBox Source #

Indicate that the contents of the text box were successfully used by the program. This clears the first line of the contents and updates the history.

Last operation