| Copyright | (c) Eric Mertens, 2016 |
|---|---|
| License | ISC |
| Maintainer | emertens@gmail.com |
| Safe Haskell | None |
| Language | Haskell2010 |
Client.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.
- data EditBox
- content :: Lens' EditBox String
- pos :: Lens' EditBox Int
- tabSeed :: Lens' EditBox (Maybe String)
- delete :: EditBox -> EditBox
- backspace :: EditBox -> EditBox
- home :: EditBox -> EditBox
- end :: EditBox -> EditBox
- killHome :: EditBox -> EditBox
- killEnd :: EditBox -> EditBox
- killWord :: Bool -> EditBox -> EditBox
- paste :: EditBox -> EditBox
- left :: EditBox -> EditBox
- right :: EditBox -> EditBox
- leftWord :: EditBox -> EditBox
- rightWord :: EditBox -> EditBox
- insert :: Char -> EditBox -> EditBox
- insertString :: String -> EditBox -> EditBox
- empty :: EditBox
- earlier :: EditBox -> Maybe EditBox
- later :: EditBox -> Maybe EditBox
- success :: EditBox -> EditBox
Documentation
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.
Kill the content from the cursor back to the previous word boundary.
When yank is set the yank buffer will be updated.
insert :: Char -> EditBox -> EditBox Source #
Insert a character at the cursor and advance the cursor.
insertString :: String -> EditBox -> EditBox Source #
Insert a string at the cursor and advance the cursor.
earlier :: EditBox -> Maybe EditBox Source #
Update the editbox to reflect the earlier element in the history.