yi-core-0.19.2: Yi editor core library

Yi.Buffer.HighLevel

Description

High level operations on buffers.

Synopsis

# Documentation

True if point at end of file

Return true if the current point is the end of a line

True if point at the last line

Return true if the current point is the start of a line

True if point at start of file

Delete one character backward

Delete backward to the sof or the new line character

Delete backward whitespace or non-whitespace depending on the character before point.

Move cursor to end of buffer

File info, size in chars, line no, col num, char num, percent

Constructors

 BufferFileInfo Fields

capitalise the first letter of this word

emacs' delete-horizontal-space with the optional argument.

Delete to the end of line, excluding it.

Delete trailing whitespace from all lines. Uses savingPositionB to get back to where it was.

Move to n lines down from top of screen

Scroll down 1 screen

Exchange point & mark.

Move to first non-space character in this line

Get the current line and column number

The same as getMaybeNextLineB but avoids the use of the Maybe type in the return by returning the empty string if there is no next line.

Returns the closest line to the current line which is non-blank, in the given direction. Returns the empty string if there is no such line (for example if we are on the top line already).

Return the region between point and mark

Get the current buffer selection mark

Get the current region boundaries. Extended to the current selection unit.

Increase (or decrease if negative) next number on line by n.

Note: Returns False if line doesn't have any characters besides a newline

True if current line consists of just a newline (no whitespace)

Is character under cursor a number.

Delete forward whitespace or non-whitespace depending on the character under point.

Move to the last non-space character in this line

Move left if on eol, but not on blank line

Move point down by n lines If line extends past width of window, count moving a single line as moving width points to the right.

Arguments

 :: YiString The string that starts a line comment -> BufferM ()

Prefix each line in the selection using the given string.

Get a (lazy) stream of lines in the buffer, starting at the next line in the given direction.

lowerise word under the cursor

Move to middle line in screen

Go to the first non space character in the line; if already there, then go to the beginning of the line.

Move point between the middle, top and bottom of the screen If the point stays at the middle, it'll be gone to the top else if the point stays at the top, it'll be gone to the bottom else it'll be gone to the middle

Move point to end of line

Move point to start of line

Move x chars forward, or to the eol, whichever is less

Move x chars back, or to the sol, whichever is less

Move to the character before the next occurence of c

Move to the next occurence of c

Move down next n paragraphs

Move to first char of next word forwards

Move to the character after the previous occurence of c

Move to the previous occurence of c

Move up prev n paragraphs

Move to first char of next word backwards

Read the line the point is on

Replace the contents of the buffer with some string

Helper function: revert the buffer contents to its on-disk version

scrollB :: Int -> BufferM () Source #

Scroll by n lines.

Move cursor to the bottom of the screen

Move cursor to the top of the screen

Scroll by n screens (negative for up)

Move to middle line in screen

Select next n paragraphs

Marks

Set the current buffer selection mark

Select the given region: set the selection mark at the regionStart and the current point at the regionEnd.

Sort the lines of the region.

Move the point to inside the viewable region

Move the visible region to include the point

Transpose two characters, (the Emacs C-t action)

Used by isNumber to test if current character under cursor is a number.

Characters [a..f] are part of a hex number only if preceded by 0x. Test if the current occurence of [a..f] is part of a hex number.

Just like toggleCommentSelectionB but automatically inserts a whitespace suffix to the inserted comment string. In fact:

Move cursor to origin

Arguments

 :: YiString The string which begins a line comment -> YiString A potentially shorter string that begins a comment -> BufferM ()

Uncomments the selection using the given line comment starting string. This only works for the comments which begin at the start of the line.

Move to n lines up from the bottom of the screen

capitalise the word under the cursor

Scroll up 1 screen

Same as scrollB, but also moves the cursor

vimScrollByB :: (Int -> Int) -> Int -> BufferM () Source #

Same as scrollByB, but also moves the cursor

Implements the same logic that emacs' mark-word does. Checks the mark point and moves it forth (or backward) for one word.