yi-0.8.2: The Haskell-Scriptable Editor

Safe HaskellNone
LanguageHaskell2010

Yi.Buffer.Region

Description

This module defines buffer operation on regions

Synopsis

Documentation

module Yi.Region

swapRegionsB :: Region -> Region -> BufferM () Source

Swap the content of two Regions

deleteRegionB :: Region -> BufferM () Source

Delete an arbitrary part of the buffer

replaceRegionB :: Region -> String -> BufferM () Source

Replace a region with a given string.

replaceRegionB' :: Region -> Rope -> BufferM () Source

Replace a region with a given rope.

replaceRegionClever :: Region -> String -> BufferM () Source

As replaceRegionB, but do a minimal edition instead of deleting the whole region and inserting it back.

readRegionB :: Region -> BufferM String Source

Read an arbitrary part of the buffer

modifyRegionB Source

Arguments

:: (String -> String)

The string modification function

-> Region

The region to modify

-> BufferM () 

Modifies the given region according to the given string transformation function

modifyRegionClever :: (String -> String) -> Region -> BufferM () Source

As modifyRegionB, but do a minimal edition instead of deleting the whole region and inserting it back.

inclusiveRegionB :: Region -> BufferM Region Source

Extend the right bound of a region to include it.

blockifyRegion :: Region -> BufferM [Region] Source

See a region as a block/rectangular region, since regions are represented by two point, this returns a list of small regions form this block region.