| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.GtkSource.Objects.Buffer
Contents
- Exported types
- Methods
- backwardIterToSourceMark
- beginNotUndoableAction
- canRedo
- canUndo
- changeCase
- createSourceMark
- endNotUndoableAction
- ensureHighlight
- forwardIterToSourceMark
- getContextClassesAtIter
- getHighlightMatchingBrackets
- getHighlightSyntax
- getImplicitTrailingNewline
- getLanguage
- getMaxUndoLevels
- getSourceMarksAtIter
- getSourceMarksAtLine
- getStyleScheme
- getUndoManager
- iterBackwardToContextClassToggle
- iterForwardToContextClassToggle
- iterHasContextClass
- joinLines
- new
- newWithLanguage
- redo
- removeSourceMarks
- setHighlightMatchingBrackets
- setHighlightSyntax
- setImplicitTrailingNewline
- setLanguage
- setMaxUndoLevels
- setStyleScheme
- setUndoManager
- sortLines
- undo
- Properties
- Signals
Description
No description available in the introspection data.
Synopsis
- newtype Buffer = Buffer (ManagedPtr Buffer)
- class GObject o => IsBuffer o
- toBuffer :: (MonadIO m, IsBuffer o) => o -> m Buffer
- noBuffer :: Maybe Buffer
- bufferBackwardIterToSourceMark :: (HasCallStack, MonadIO m, IsBuffer a) => a -> TextIter -> Maybe Text -> m Bool
- bufferBeginNotUndoableAction :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m ()
- bufferCanRedo :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m Bool
- bufferCanUndo :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m Bool
- bufferChangeCase :: (HasCallStack, MonadIO m, IsBuffer a) => a -> ChangeCaseType -> TextIter -> TextIter -> m ()
- bufferCreateSourceMark :: (HasCallStack, MonadIO m, IsBuffer a) => a -> Maybe Text -> Text -> TextIter -> m Mark
- bufferEndNotUndoableAction :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m ()
- bufferEnsureHighlight :: (HasCallStack, MonadIO m, IsBuffer a) => a -> TextIter -> TextIter -> m ()
- bufferForwardIterToSourceMark :: (HasCallStack, MonadIO m, IsBuffer a) => a -> TextIter -> Maybe Text -> m Bool
- bufferGetContextClassesAtIter :: (HasCallStack, MonadIO m, IsBuffer a) => a -> TextIter -> m [Text]
- bufferGetHighlightMatchingBrackets :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m Bool
- bufferGetHighlightSyntax :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m Bool
- bufferGetImplicitTrailingNewline :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m Bool
- bufferGetLanguage :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m (Maybe Language)
- bufferGetMaxUndoLevels :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m Int32
- bufferGetSourceMarksAtIter :: (HasCallStack, MonadIO m, IsBuffer a) => a -> TextIter -> Maybe Text -> m [Mark]
- bufferGetSourceMarksAtLine :: (HasCallStack, MonadIO m, IsBuffer a) => a -> Int32 -> Maybe Text -> m [Mark]
- bufferGetStyleScheme :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m (Maybe StyleScheme)
- bufferGetUndoManager :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m (Maybe UndoManager)
- bufferIterBackwardToContextClassToggle :: (HasCallStack, MonadIO m, IsBuffer a) => a -> TextIter -> Text -> m Bool
- bufferIterForwardToContextClassToggle :: (HasCallStack, MonadIO m, IsBuffer a) => a -> TextIter -> Text -> m Bool
- bufferIterHasContextClass :: (HasCallStack, MonadIO m, IsBuffer a) => a -> TextIter -> Text -> m Bool
- bufferJoinLines :: (HasCallStack, MonadIO m, IsBuffer a) => a -> TextIter -> TextIter -> m ()
- bufferNew :: (HasCallStack, MonadIO m, IsTextTagTable a) => Maybe a -> m Buffer
- bufferNewWithLanguage :: (HasCallStack, MonadIO m, IsLanguage a) => a -> m Buffer
- bufferRedo :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m ()
- bufferRemoveSourceMarks :: (HasCallStack, MonadIO m, IsBuffer a) => a -> TextIter -> TextIter -> Maybe Text -> m ()
- bufferSetHighlightMatchingBrackets :: (HasCallStack, MonadIO m, IsBuffer a) => a -> Bool -> m ()
- bufferSetHighlightSyntax :: (HasCallStack, MonadIO m, IsBuffer a) => a -> Bool -> m ()
- bufferSetImplicitTrailingNewline :: (HasCallStack, MonadIO m, IsBuffer a) => a -> Bool -> m ()
- bufferSetLanguage :: (HasCallStack, MonadIO m, IsBuffer a, IsLanguage b) => a -> Maybe b -> m ()
- bufferSetMaxUndoLevels :: (HasCallStack, MonadIO m, IsBuffer a) => a -> Int32 -> m ()
- bufferSetStyleScheme :: (HasCallStack, MonadIO m, IsBuffer a, IsStyleScheme b) => a -> Maybe b -> m ()
- bufferSetUndoManager :: (HasCallStack, MonadIO m, IsBuffer a, IsUndoManager b) => a -> Maybe b -> m ()
- bufferSortLines :: (HasCallStack, MonadIO m, IsBuffer a) => a -> TextIter -> TextIter -> [SortFlags] -> Int32 -> m ()
- bufferUndo :: (HasCallStack, MonadIO m, IsBuffer a) => a -> m ()
- getBufferCanRedo :: (MonadIO m, IsBuffer o) => o -> m Bool
- getBufferCanUndo :: (MonadIO m, IsBuffer o) => o -> m Bool
- constructBufferHighlightMatchingBrackets :: IsBuffer o => Bool -> IO (GValueConstruct o)
- getBufferHighlightMatchingBrackets :: (MonadIO m, IsBuffer o) => o -> m Bool
- setBufferHighlightMatchingBrackets :: (MonadIO m, IsBuffer o) => o -> Bool -> m ()
- constructBufferHighlightSyntax :: IsBuffer o => Bool -> IO (GValueConstruct o)
- getBufferHighlightSyntax :: (MonadIO m, IsBuffer o) => o -> m Bool
- setBufferHighlightSyntax :: (MonadIO m, IsBuffer o) => o -> Bool -> m ()
- constructBufferImplicitTrailingNewline :: IsBuffer o => Bool -> IO (GValueConstruct o)
- getBufferImplicitTrailingNewline :: (MonadIO m, IsBuffer o) => o -> m Bool
- setBufferImplicitTrailingNewline :: (MonadIO m, IsBuffer o) => o -> Bool -> m ()
- clearBufferLanguage :: (MonadIO m, IsBuffer o) => o -> m ()
- constructBufferLanguage :: (IsBuffer o, IsLanguage a) => a -> IO (GValueConstruct o)
- getBufferLanguage :: (MonadIO m, IsBuffer o) => o -> m (Maybe Language)
- setBufferLanguage :: (MonadIO m, IsBuffer o, IsLanguage a) => o -> a -> m ()
- constructBufferMaxUndoLevels :: IsBuffer o => Int32 -> IO (GValueConstruct o)
- getBufferMaxUndoLevels :: (MonadIO m, IsBuffer o) => o -> m Int32
- setBufferMaxUndoLevels :: (MonadIO m, IsBuffer o) => o -> Int32 -> m ()
- clearBufferStyleScheme :: (MonadIO m, IsBuffer o) => o -> m ()
- constructBufferStyleScheme :: (IsBuffer o, IsStyleScheme a) => a -> IO (GValueConstruct o)
- getBufferStyleScheme :: (MonadIO m, IsBuffer o) => o -> m (Maybe StyleScheme)
- setBufferStyleScheme :: (MonadIO m, IsBuffer o, IsStyleScheme a) => o -> a -> m ()
- clearBufferUndoManager :: (MonadIO m, IsBuffer o) => o -> m ()
- constructBufferUndoManager :: (IsBuffer o, IsUndoManager a) => a -> IO (GValueConstruct o)
- getBufferUndoManager :: (MonadIO m, IsBuffer o) => o -> m (Maybe UndoManager)
- setBufferUndoManager :: (MonadIO m, IsBuffer o, IsUndoManager a) => o -> a -> m ()
- type BufferBracketMatchedCallback = TextIter -> BracketMatchType -> IO ()
- type C_BufferBracketMatchedCallback = Ptr () -> Ptr TextIter -> CUInt -> Ptr () -> IO ()
- afterBufferBracketMatched :: (IsBuffer a, MonadIO m) => a -> BufferBracketMatchedCallback -> m SignalHandlerId
- genClosure_BufferBracketMatched :: BufferBracketMatchedCallback -> IO Closure
- mk_BufferBracketMatchedCallback :: C_BufferBracketMatchedCallback -> IO (FunPtr C_BufferBracketMatchedCallback)
- noBufferBracketMatchedCallback :: Maybe BufferBracketMatchedCallback
- onBufferBracketMatched :: (IsBuffer a, MonadIO m) => a -> BufferBracketMatchedCallback -> m SignalHandlerId
- wrap_BufferBracketMatchedCallback :: BufferBracketMatchedCallback -> C_BufferBracketMatchedCallback
- type BufferHighlightUpdatedCallback = TextIter -> TextIter -> IO ()
- type C_BufferHighlightUpdatedCallback = Ptr () -> Ptr TextIter -> Ptr TextIter -> Ptr () -> IO ()
- afterBufferHighlightUpdated :: (IsBuffer a, MonadIO m) => a -> BufferHighlightUpdatedCallback -> m SignalHandlerId
- genClosure_BufferHighlightUpdated :: BufferHighlightUpdatedCallback -> IO Closure
- mk_BufferHighlightUpdatedCallback :: C_BufferHighlightUpdatedCallback -> IO (FunPtr C_BufferHighlightUpdatedCallback)
- noBufferHighlightUpdatedCallback :: Maybe BufferHighlightUpdatedCallback
- onBufferHighlightUpdated :: (IsBuffer a, MonadIO m) => a -> BufferHighlightUpdatedCallback -> m SignalHandlerId
- wrap_BufferHighlightUpdatedCallback :: BufferHighlightUpdatedCallback -> C_BufferHighlightUpdatedCallback
- type BufferRedoCallback = IO ()
- type C_BufferRedoCallback = Ptr () -> Ptr () -> IO ()
- afterBufferRedo :: (IsBuffer a, MonadIO m) => a -> BufferRedoCallback -> m SignalHandlerId
- genClosure_BufferRedo :: BufferRedoCallback -> IO Closure
- mk_BufferRedoCallback :: C_BufferRedoCallback -> IO (FunPtr C_BufferRedoCallback)
- noBufferRedoCallback :: Maybe BufferRedoCallback
- onBufferRedo :: (IsBuffer a, MonadIO m) => a -> BufferRedoCallback -> m SignalHandlerId
- wrap_BufferRedoCallback :: BufferRedoCallback -> C_BufferRedoCallback
- type BufferSourceMarkUpdatedCallback = TextMark -> IO ()
- type C_BufferSourceMarkUpdatedCallback = Ptr () -> Ptr TextMark -> Ptr () -> IO ()
- afterBufferSourceMarkUpdated :: (IsBuffer a, MonadIO m) => a -> BufferSourceMarkUpdatedCallback -> m SignalHandlerId
- genClosure_BufferSourceMarkUpdated :: BufferSourceMarkUpdatedCallback -> IO Closure
- mk_BufferSourceMarkUpdatedCallback :: C_BufferSourceMarkUpdatedCallback -> IO (FunPtr C_BufferSourceMarkUpdatedCallback)
- noBufferSourceMarkUpdatedCallback :: Maybe BufferSourceMarkUpdatedCallback
- onBufferSourceMarkUpdated :: (IsBuffer a, MonadIO m) => a -> BufferSourceMarkUpdatedCallback -> m SignalHandlerId
- wrap_BufferSourceMarkUpdatedCallback :: BufferSourceMarkUpdatedCallback -> C_BufferSourceMarkUpdatedCallback
- type BufferUndoCallback = IO ()
- type C_BufferUndoCallback = Ptr () -> Ptr () -> IO ()
- afterBufferUndo :: (IsBuffer a, MonadIO m) => a -> BufferUndoCallback -> m SignalHandlerId
- genClosure_BufferUndo :: BufferUndoCallback -> IO Closure
- mk_BufferUndoCallback :: C_BufferUndoCallback -> IO (FunPtr C_BufferUndoCallback)
- noBufferUndoCallback :: Maybe BufferUndoCallback
- onBufferUndo :: (IsBuffer a, MonadIO m) => a -> BufferUndoCallback -> m SignalHandlerId
- wrap_BufferUndoCallback :: BufferUndoCallback -> C_BufferUndoCallback
Exported types
Memory-managed wrapper type.
Constructors
| Buffer (ManagedPtr Buffer) |
Instances
| GObject Buffer Source # | |
Defined in GI.GtkSource.Objects.Buffer Methods gobjectType :: Buffer -> IO GType # | |
| IsObject Buffer Source # | |
Defined in GI.GtkSource.Objects.Buffer | |
| IsTextBuffer Buffer Source # | |
Defined in GI.GtkSource.Objects.Buffer | |
| IsBuffer Buffer Source # | |
Defined in GI.GtkSource.Objects.Buffer | |
class GObject o => IsBuffer o Source #
Instances
| (GObject a, (UnknownAncestorError Buffer a :: Constraint)) => IsBuffer a Source # | |
Defined in GI.GtkSource.Objects.Buffer | |
| IsBuffer Buffer Source # | |
Defined in GI.GtkSource.Objects.Buffer | |
Methods
backwardIterToSourceMark
beginNotUndoableAction
bufferBeginNotUndoableAction Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> m () |
Marks the beginning of a not undoable action on the buffer, disabling the undo manager. Typically you would call this function before initially setting the contents of the buffer (e.g. when loading a file in a text editor).
You may nest bufferBeginNotUndoableAction /
bufferEndNotUndoableAction blocks.
canRedo
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> m Bool | Returns: |
Determines whether a source buffer can redo the last action (i.e. if the last operation was an undo).
canUndo
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> m Bool | Returns: |
Determines whether a source buffer can undo the last action.
changeCase
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> ChangeCaseType |
|
| -> TextIter |
|
| -> TextIter |
|
| -> m () |
Changes the case of the text between the specified iterators.
Since: 3.12
createSourceMark
bufferCreateSourceMark Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> Maybe Text |
|
| -> Text |
|
| -> TextIter |
|
| -> m Mark | Returns: a new |
Creates a source mark in the buffer of category category. A source mark is
a TextMark but organised into categories. Depending on the category
a pixbuf can be specified that will be displayed along the line of the mark.
Like a TextMark, a Mark can be anonymous if the
passed name is Nothing. Also, the buffer owns the marks so you
shouldn't unreference it.
Marks always have left gravity and are moved to the beginning of the line when the user deletes the line they were in.
Typical uses for a source mark are bookmarks, breakpoints, current executing instruction indication in a source file, etc..
Since: 2.2
endNotUndoableAction
bufferEndNotUndoableAction Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> m () |
Marks the end of a not undoable action on the buffer. When the last not undoable block is closed through the call to this function, the list of undo actions is cleared and the undo manager is re-enabled.
ensureHighlight
bufferEnsureHighlight Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> TextIter |
|
| -> TextIter |
|
| -> m () |
Forces buffer to analyze and highlight the given area synchronously.
<note> <para> This is a potentially slow operation and should be used only when you need to make sure that some text not currently visible is highlighted, for instance before printing. </para> </note>
forwardIterToSourceMark
getContextClassesAtIter
bufferGetContextClassesAtIter Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> TextIter |
|
| -> m [Text] | Returns: a new |
Get all defined context classes at iter.
See the Buffer description for the list of default context classes.
Since: 2.10
getHighlightMatchingBrackets
bufferGetHighlightMatchingBrackets Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> m Bool | Returns: |
Determines whether bracket match highlighting is activated for the source buffer.
getHighlightSyntax
bufferGetHighlightSyntax Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> m Bool | Returns: |
Determines whether syntax highlighting is activated in the source buffer.
getImplicitTrailingNewline
bufferGetImplicitTrailingNewline Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> m Bool | Returns: whether the |
No description available in the introspection data.
Since: 3.14
getLanguage
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> m (Maybe Language) | Returns: the |
Returns the Language associated with the buffer,
see bufferSetLanguage. The returned object should not be
unreferenced by the user.
getMaxUndoLevels
bufferGetMaxUndoLevels Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> m Int32 | Returns: the maximum number of possible undo levels or -1 if no limit is set. |
Determines the number of undo levels the buffer will track for buffer edits.
getSourceMarksAtIter
bufferGetSourceMarksAtIter Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> TextIter |
|
| -> Maybe Text |
|
| -> m [Mark] | Returns:
a newly allocated |
Returns the list of marks of the given category at iter. If category
is Nothing it returns all marks at iter.
Since: 2.2
getSourceMarksAtLine
bufferGetSourceMarksAtLine Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> Int32 |
|
| -> Maybe Text |
|
| -> m [Mark] | Returns:
a newly allocated |
Returns the list of marks of the given category at line.
If category is Nothing, all marks at line are returned.
Since: 2.2
getStyleScheme
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> m (Maybe StyleScheme) | Returns: the |
Returns the StyleScheme associated with the buffer,
see bufferSetStyleScheme.
The returned object should not be unreferenced by the user.
getUndoManager
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> m (Maybe UndoManager) | Returns: the |
Returns the UndoManager associated with the buffer,
see bufferSetUndoManager. The returned object should not be
unreferenced by the user.
iterBackwardToContextClassToggle
bufferIterBackwardToContextClassToggle Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> TextIter |
|
| -> Text |
|
| -> m Bool | Returns: whether we found a context class toggle before |
Moves backward to the next toggle (on or off) of the context class. If no
matching context class toggles are found, returns False, otherwise True.
Does not return toggles located at iter, only toggles after iter. Sets
iter to the location of the toggle, or to the end of the buffer if no
toggle is found.
See the Buffer description for the list of default context classes.
Since: 2.10
iterForwardToContextClassToggle
bufferIterForwardToContextClassToggle Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> TextIter |
|
| -> Text |
|
| -> m Bool | Returns: whether we found a context class toggle after |
Moves forward to the next toggle (on or off) of the context class. If no
matching context class toggles are found, returns False, otherwise True.
Does not return toggles located at iter, only toggles after iter. Sets
iter to the location of the toggle, or to the end of the buffer if no
toggle is found.
See the Buffer description for the list of default context classes.
Since: 2.10
iterHasContextClass
bufferIterHasContextClass Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> TextIter |
|
| -> Text |
|
| -> m Bool | Returns: whether |
Check if the class contextClass is set on iter.
See the Buffer description for the list of default context classes.
Since: 2.10
joinLines
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> TextIter |
|
| -> TextIter |
|
| -> m () |
Joins the lines of text between the specified iterators.
Since: 3.16
new
Arguments
| :: (HasCallStack, MonadIO m, IsTextTagTable a) | |
| => Maybe a |
|
| -> m Buffer | Returns: a new source buffer. |
Creates a new source buffer.
newWithLanguage
bufferNewWithLanguage Source #
Arguments
| :: (HasCallStack, MonadIO m, IsLanguage a) | |
| => a |
|
| -> m Buffer | Returns: a new source buffer which will highlight text
according to the highlighting patterns in |
Creates a new source buffer using the highlighting patterns in
language. This is equivalent to creating a new source buffer with
a new tag table and then calling bufferSetLanguage.
redo
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> m () |
Redoes the last undo operation. Use bufferCanRedo
to check whether a call to this function will have any effect.
This function emits the Buffer::redo signal.
removeSourceMarks
bufferRemoveSourceMarks Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> TextIter |
|
| -> TextIter |
|
| -> Maybe Text |
|
| -> m () |
Remove all marks of category between start and end from the buffer.
If category is NULL, all marks in the range will be removed.
Since: 2.2
setHighlightMatchingBrackets
bufferSetHighlightMatchingBrackets Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> Bool |
|
| -> m () |
Controls the bracket match highlighting function in the buffer. If activated, when you position your cursor over a bracket character (a parenthesis, a square bracket, etc.) the matching opening or closing bracket character will be highlighted.
setHighlightSyntax
bufferSetHighlightSyntax Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> Bool |
|
| -> m () |
Controls whether syntax is highlighted in the buffer.
If highlight is True, the text will be highlighted according to the syntax
patterns specified in the Language set with
bufferSetLanguage.
If highlight is False, syntax highlighting is disabled and all the
TextTag objects that have been added by the syntax highlighting engine
are removed from the buffer.
setImplicitTrailingNewline
bufferSetImplicitTrailingNewline Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> Bool |
|
| -> m () |
Sets whether the buffer has an implicit trailing newline.
If an explicit trailing newline is present in a TextBuffer, TextView
shows it as an empty line. This is generally not what the user expects.
If implicitTrailingNewline is True (the default value):
- when a FileLoader loads the content of a file into the buffer,
the trailing newline (if present in the file) is not inserted into the
buffer.
- when a FileSaver saves the content of the buffer into a file, a
trailing newline is added to the file.
On the other hand, if implicitTrailingNewline is False, the file's
content is not modified when loaded into the buffer, and the buffer's
content is not modified when saved into a file.
Since: 3.14
setLanguage
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a, IsLanguage b) | |
| => a |
|
| -> Maybe b | |
| -> m () |
Associates a Language with the buffer.
Note that a Language affects not only the syntax highlighting, but
also the [context classes][context-classes]. If you want to disable just the
syntax highlighting, see bufferSetHighlightSyntax.
The buffer holds a reference to language.
setMaxUndoLevels
bufferSetMaxUndoLevels Source #
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> Int32 |
|
| -> m () |
Sets the number of undo levels for user actions the buffer will track. If the number of user actions exceeds the limit set by this function, older actions will be discarded.
If maxUndoLevels is -1, the undo/redo is unlimited.
If maxUndoLevels is 0, the undo/redo is disabled.
setStyleScheme
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a, IsStyleScheme b) | |
| => a |
|
| -> Maybe b |
|
| -> m () |
Sets a StyleScheme to be used by the buffer and the view.
Note that a StyleScheme affects not only the syntax highlighting,
but also other View features such as highlighting the current line,
matching brackets, the line numbers, etc.
Instead of setting a Nothing scheme, it is better to disable syntax
highlighting with bufferSetHighlightSyntax, and setting the
StyleScheme with the "classic" or "tango" ID, because those two
style schemes follow more closely the GTK+ theme (for example for the
background color).
The buffer holds a reference to scheme.
setUndoManager
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a, IsUndoManager b) | |
| => a |
|
| -> Maybe b |
|
| -> m () |
Set the buffer undo manager. If manager is Nothing the default undo manager
will be set.
sortLines
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> TextIter |
|
| -> TextIter |
|
| -> [SortFlags] |
|
| -> Int32 |
|
| -> m () |
Sort the lines of text between the specified iterators.
Since: 3.18
undo
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a) | |
| => a |
|
| -> m () |
Undoes the last user action which modified the buffer. Use
bufferCanUndo to check whether a call to this
function will have any effect.
This function emits the Buffer::undo signal.
Properties
canRedo
No description available in the introspection data.
getBufferCanRedo :: (MonadIO m, IsBuffer o) => o -> m Bool Source #
Get the value of the “can-redo” property.
When overloading is enabled, this is equivalent to
get buffer #canRedo
canUndo
No description available in the introspection data.
getBufferCanUndo :: (MonadIO m, IsBuffer o) => o -> m Bool Source #
Get the value of the “can-undo” property.
When overloading is enabled, this is equivalent to
get buffer #canUndo
highlightMatchingBrackets
Whether to highlight matching brackets in the buffer.
constructBufferHighlightMatchingBrackets :: IsBuffer o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “highlight-matching-brackets” property. This is rarely needed directly, but it is used by new.
getBufferHighlightMatchingBrackets :: (MonadIO m, IsBuffer o) => o -> m Bool Source #
Get the value of the “highlight-matching-brackets” property.
When overloading is enabled, this is equivalent to
get buffer #highlightMatchingBrackets
setBufferHighlightMatchingBrackets :: (MonadIO m, IsBuffer o) => o -> Bool -> m () Source #
Set the value of the “highlight-matching-brackets” property.
When overloading is enabled, this is equivalent to
setbuffer [ #highlightMatchingBrackets:=value ]
highlightSyntax
Whether to highlight syntax in the buffer.
constructBufferHighlightSyntax :: IsBuffer o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “highlight-syntax” property. This is rarely needed directly, but it is used by new.
getBufferHighlightSyntax :: (MonadIO m, IsBuffer o) => o -> m Bool Source #
Get the value of the “highlight-syntax” property.
When overloading is enabled, this is equivalent to
get buffer #highlightSyntax
setBufferHighlightSyntax :: (MonadIO m, IsBuffer o) => o -> Bool -> m () Source #
Set the value of the “highlight-syntax” property.
When overloading is enabled, this is equivalent to
setbuffer [ #highlightSyntax:=value ]
implicitTrailingNewline
Whether the buffer has an implicit trailing newline. See
bufferSetImplicitTrailingNewline.
Since: 3.14
constructBufferImplicitTrailingNewline :: IsBuffer o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “implicit-trailing-newline” property. This is rarely needed directly, but it is used by new.
getBufferImplicitTrailingNewline :: (MonadIO m, IsBuffer o) => o -> m Bool Source #
Get the value of the “implicit-trailing-newline” property.
When overloading is enabled, this is equivalent to
get buffer #implicitTrailingNewline
setBufferImplicitTrailingNewline :: (MonadIO m, IsBuffer o) => o -> Bool -> m () Source #
Set the value of the “implicit-trailing-newline” property.
When overloading is enabled, this is equivalent to
setbuffer [ #implicitTrailingNewline:=value ]
language
No description available in the introspection data.
clearBufferLanguage :: (MonadIO m, IsBuffer o) => o -> m () Source #
Set the value of the “language” property to Nothing.
When overloading is enabled, this is equivalent to
clear #language
constructBufferLanguage :: (IsBuffer o, IsLanguage a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “language” property. This is rarely needed directly, but it is used by new.
getBufferLanguage :: (MonadIO m, IsBuffer o) => o -> m (Maybe Language) Source #
Get the value of the “language” property.
When overloading is enabled, this is equivalent to
get buffer #language
setBufferLanguage :: (MonadIO m, IsBuffer o, IsLanguage a) => o -> a -> m () Source #
Set the value of the “language” property.
When overloading is enabled, this is equivalent to
setbuffer [ #language:=value ]
maxUndoLevels
Number of undo levels for the buffer. -1 means no limit. This property will only affect the default undo manager.
constructBufferMaxUndoLevels :: IsBuffer o => Int32 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “max-undo-levels” property. This is rarely needed directly, but it is used by new.
getBufferMaxUndoLevels :: (MonadIO m, IsBuffer o) => o -> m Int32 Source #
Get the value of the “max-undo-levels” property.
When overloading is enabled, this is equivalent to
get buffer #maxUndoLevels
setBufferMaxUndoLevels :: (MonadIO m, IsBuffer o) => o -> Int32 -> m () Source #
Set the value of the “max-undo-levels” property.
When overloading is enabled, this is equivalent to
setbuffer [ #maxUndoLevels:=value ]
styleScheme
Style scheme. It contains styles for syntax highlighting, optionally foreground, background, cursor color, current line color, and matching brackets style.
clearBufferStyleScheme :: (MonadIO m, IsBuffer o) => o -> m () Source #
Set the value of the “style-scheme” property to Nothing.
When overloading is enabled, this is equivalent to
clear #styleScheme
constructBufferStyleScheme :: (IsBuffer o, IsStyleScheme a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “style-scheme” property. This is rarely needed directly, but it is used by new.
getBufferStyleScheme :: (MonadIO m, IsBuffer o) => o -> m (Maybe StyleScheme) Source #
Get the value of the “style-scheme” property.
When overloading is enabled, this is equivalent to
get buffer #styleScheme
setBufferStyleScheme :: (MonadIO m, IsBuffer o, IsStyleScheme a) => o -> a -> m () Source #
Set the value of the “style-scheme” property.
When overloading is enabled, this is equivalent to
setbuffer [ #styleScheme:=value ]
undoManager
No description available in the introspection data.
clearBufferUndoManager :: (MonadIO m, IsBuffer o) => o -> m () Source #
Set the value of the “undo-manager” property to Nothing.
When overloading is enabled, this is equivalent to
clear #undoManager
constructBufferUndoManager :: (IsBuffer o, IsUndoManager a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “undo-manager” property. This is rarely needed directly, but it is used by new.
getBufferUndoManager :: (MonadIO m, IsBuffer o) => o -> m (Maybe UndoManager) Source #
Get the value of the “undo-manager” property.
When overloading is enabled, this is equivalent to
get buffer #undoManager
setBufferUndoManager :: (MonadIO m, IsBuffer o, IsUndoManager a) => o -> a -> m () Source #
Set the value of the “undo-manager” property.
When overloading is enabled, this is equivalent to
setbuffer [ #undoManager:=value ]
Signals
bracketMatched
type BufferBracketMatchedCallback Source #
Arguments
| = TextIter |
|
| -> BracketMatchType |
|
| -> IO () |
iter is set to a valid iterator pointing to the matching bracket
if state is BracketMatchTypeFound. Otherwise iter is
meaningless.
The signal is emitted only when the state changes, typically when
the cursor moves.
A use-case for this signal is to show messages in a Statusbar.
Since: 2.12
type C_BufferBracketMatchedCallback = Ptr () -> Ptr TextIter -> CUInt -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
afterBufferBracketMatched :: (IsBuffer a, MonadIO m) => a -> BufferBracketMatchedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “bracket-matched” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after buffer #bracketMatched callback
genClosure_BufferBracketMatched :: BufferBracketMatchedCallback -> IO Closure Source #
Wrap the callback into a Closure.
mk_BufferBracketMatchedCallback :: C_BufferBracketMatchedCallback -> IO (FunPtr C_BufferBracketMatchedCallback) Source #
Generate a function pointer callable from C code, from a C_BufferBracketMatchedCallback.
noBufferBracketMatchedCallback :: Maybe BufferBracketMatchedCallback Source #
A convenience synonym for .Nothing :: Maybe BufferBracketMatchedCallback
onBufferBracketMatched :: (IsBuffer a, MonadIO m) => a -> BufferBracketMatchedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “bracket-matched” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on buffer #bracketMatched callback
wrap_BufferBracketMatchedCallback :: BufferBracketMatchedCallback -> C_BufferBracketMatchedCallback Source #
Wrap a BufferBracketMatchedCallback into a C_BufferBracketMatchedCallback.
highlightUpdated
type BufferHighlightUpdatedCallback Source #
Arguments
| = TextIter |
|
| -> TextIter |
|
| -> IO () |
The ::highlight-updated signal is emitted when the syntax
highlighting and [context classes][context-classes] are updated in a
certain region of the buffer.
type C_BufferHighlightUpdatedCallback = Ptr () -> Ptr TextIter -> Ptr TextIter -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
afterBufferHighlightUpdated :: (IsBuffer a, MonadIO m) => a -> BufferHighlightUpdatedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “highlight-updated” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after buffer #highlightUpdated callback
genClosure_BufferHighlightUpdated :: BufferHighlightUpdatedCallback -> IO Closure Source #
Wrap the callback into a Closure.
mk_BufferHighlightUpdatedCallback :: C_BufferHighlightUpdatedCallback -> IO (FunPtr C_BufferHighlightUpdatedCallback) Source #
Generate a function pointer callable from C code, from a C_BufferHighlightUpdatedCallback.
noBufferHighlightUpdatedCallback :: Maybe BufferHighlightUpdatedCallback Source #
A convenience synonym for .Nothing :: Maybe BufferHighlightUpdatedCallback
onBufferHighlightUpdated :: (IsBuffer a, MonadIO m) => a -> BufferHighlightUpdatedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “highlight-updated” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on buffer #highlightUpdated callback
wrap_BufferHighlightUpdatedCallback :: BufferHighlightUpdatedCallback -> C_BufferHighlightUpdatedCallback Source #
Wrap a BufferHighlightUpdatedCallback into a C_BufferHighlightUpdatedCallback.
redo
type BufferRedoCallback = IO () Source #
The ::redo signal is emitted to redo the last undo operation.
type C_BufferRedoCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
afterBufferRedo :: (IsBuffer a, MonadIO m) => a -> BufferRedoCallback -> m SignalHandlerId Source #
Connect a signal handler for the “redo” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after buffer #redo callback
genClosure_BufferRedo :: BufferRedoCallback -> IO Closure Source #
Wrap the callback into a Closure.
mk_BufferRedoCallback :: C_BufferRedoCallback -> IO (FunPtr C_BufferRedoCallback) Source #
Generate a function pointer callable from C code, from a C_BufferRedoCallback.
noBufferRedoCallback :: Maybe BufferRedoCallback Source #
A convenience synonym for .Nothing :: Maybe BufferRedoCallback
onBufferRedo :: (IsBuffer a, MonadIO m) => a -> BufferRedoCallback -> m SignalHandlerId Source #
Connect a signal handler for the “redo” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on buffer #redo callback
wrap_BufferRedoCallback :: BufferRedoCallback -> C_BufferRedoCallback Source #
Wrap a BufferRedoCallback into a C_BufferRedoCallback.
sourceMarkUpdated
type BufferSourceMarkUpdatedCallback Source #
The ::source-mark-updated signal is emitted each time
a mark is added to, moved or removed from the buffer.
type C_BufferSourceMarkUpdatedCallback = Ptr () -> Ptr TextMark -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
afterBufferSourceMarkUpdated :: (IsBuffer a, MonadIO m) => a -> BufferSourceMarkUpdatedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “source-mark-updated” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after buffer #sourceMarkUpdated callback
genClosure_BufferSourceMarkUpdated :: BufferSourceMarkUpdatedCallback -> IO Closure Source #
Wrap the callback into a Closure.
mk_BufferSourceMarkUpdatedCallback :: C_BufferSourceMarkUpdatedCallback -> IO (FunPtr C_BufferSourceMarkUpdatedCallback) Source #
Generate a function pointer callable from C code, from a C_BufferSourceMarkUpdatedCallback.
noBufferSourceMarkUpdatedCallback :: Maybe BufferSourceMarkUpdatedCallback Source #
A convenience synonym for .Nothing :: Maybe BufferSourceMarkUpdatedCallback
onBufferSourceMarkUpdated :: (IsBuffer a, MonadIO m) => a -> BufferSourceMarkUpdatedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “source-mark-updated” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on buffer #sourceMarkUpdated callback
wrap_BufferSourceMarkUpdatedCallback :: BufferSourceMarkUpdatedCallback -> C_BufferSourceMarkUpdatedCallback Source #
Wrap a BufferSourceMarkUpdatedCallback into a C_BufferSourceMarkUpdatedCallback.
undo
type BufferUndoCallback = IO () Source #
The ::undo signal is emitted to undo the last user action which modified the buffer.
type C_BufferUndoCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
afterBufferUndo :: (IsBuffer a, MonadIO m) => a -> BufferUndoCallback -> m SignalHandlerId Source #
Connect a signal handler for the “undo” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after buffer #undo callback
genClosure_BufferUndo :: BufferUndoCallback -> IO Closure Source #
Wrap the callback into a Closure.
mk_BufferUndoCallback :: C_BufferUndoCallback -> IO (FunPtr C_BufferUndoCallback) Source #
Generate a function pointer callable from C code, from a C_BufferUndoCallback.
noBufferUndoCallback :: Maybe BufferUndoCallback Source #
A convenience synonym for .Nothing :: Maybe BufferUndoCallback
onBufferUndo :: (IsBuffer a, MonadIO m) => a -> BufferUndoCallback -> m SignalHandlerId Source #
Connect a signal handler for the “undo” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on buffer #undo callback