gtksource.search_context
Module for [SearchContext] class
Types 3
Methods
SearchContext self()Returns `this`, for use in `with` statements.SearchContextGidBuilder builder()Get builder for [gtksource.search_context.SearchContext] Returns: New builder objectgtksource.buffer.Buffer buffer() @propertyGet `buffer` property. Returns: The #GtkSourceBuffer associated to the search context.void highlight(bool propval) @propertySet `highlight` property. Params: propval = Highlight the search occurrences.gtksource.style.Style matchStyle() @propertyGet `matchStyle` property. Returns: A #GtkSourceStyle, or null for theme's scheme default style.void matchStyle(gtksource.style.Style propval) @propertySet `matchStyle` property. Params: propval = A #GtkSourceStyle, or null for theme's scheme default style.int occurrencesCount() @propertyGet `occurrencesCount` property. Returns: The total number of search occurrences. If the search is disabled, the value is 0. If the buffer is not already fully scanned, the value is -1.void * regexError() @propertyGet `regexError` property. Returns: If the regex search pattern doesn't follow all the rules, this #GError property will be set. If the pattern is valid, the value is null.gtksource.search_settings.SearchSettings settings() @propertyGet `settings` property. Returns: The #GtkSourceSearchSettings associated to the search context.bool backward(gtk.text_iter.TextIter iter, out gtk.text_iter.TextIter matchStart, out gtk.text_iter.TextIter matchEnd, out bool hasWrappedAround)Synchronous backward search. It is recommended to use the asynchronous functions instead, to not block the user interface. However, if you are sure that the buffer is small, this function is more c...void backwardAsync(gtk.text_iter.TextIter iter, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)The asynchronous version of [gtksource.search_context.SearchContext.backward].bool backwardFinish(gio.async_result.AsyncResult result, out gtk.text_iter.TextIter matchStart, out gtk.text_iter.TextIter matchEnd, out bool hasWrappedAround)Finishes a backward search started with [gtksource.search_context.SearchContext.backwardAsync].bool forward(gtk.text_iter.TextIter iter, out gtk.text_iter.TextIter matchStart, out gtk.text_iter.TextIter matchEnd, out bool hasWrappedAround)Synchronous forward search. It is recommended to use the asynchronous functions instead, to not block the user interface. However, if you are sure that the buffer is small, this function is more co...void forwardAsync(gtk.text_iter.TextIter iter, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)The asynchronous version of [gtksource.search_context.SearchContext.forward].bool forwardFinish(gio.async_result.AsyncResult result, out gtk.text_iter.TextIter matchStart, out gtk.text_iter.TextIter matchEnd, out bool hasWrappedAround)Finishes a forward search started with [gtksource.search_context.SearchContext.forwardAsync].bool getHighlight()int getOccurrencePosition(gtk.text_iter.TextIter matchStart, gtk.text_iter.TextIter matchEnd)Gets the position of a search occurrence. If the buffer is not already fully scanned, the position may be unknown, and -1 is returned. If 0 is returned, it means that this part of the buffer has al...int getOccurrencesCount()Gets the total number of search occurrences. If the buffer is not already fully scanned, the total number of occurrences is unknown, and -1 is returned. Returns: the total number of search occurren...glib.error.ErrorWrap getRegexError()Regular expression patterns must follow certain rules. If #GtkSourceSearchSettings:search-text breaks a rule, the error can be retrieved with this function. The error domain is #GREGEXERROR.bool replace(gtk.text_iter.TextIter matchStart, gtk.text_iter.TextIter matchEnd, string replace)Replaces a search match by another text. If matchstart and matchend doesn't correspond to a search match, false is returned.uint replaceAll(string replace)Replaces all search matches by another text. It is a synchronous function, so it can block the user interface.void setHighlight(bool highlight)Enables or disables the search occurrences highlighting.void setMatchStyle(gtksource.style.Style matchStyle = null)Set the style to apply on search matches. If matchstyle is null, default theme's scheme 'match-style' will be used. To enable or disable the search highlighting, use [gtksource.searchcontext.Search...Constructors
this(gtksource.buffer.Buffer buffer, gtksource.search_settings.SearchSettings settings = null)Creates a new search context, associated with buffer, and customized with settings. If settings is null, a new #GtkSourceSearchSettings object will be created, that you can retrieve with [gtksource...Methods
T buffer(gtksource.buffer.Buffer propval)Set `buffer` property. Params: propval = The #GtkSourceBuffer associated to the search context. Returns: Builder instance for fluent chainingT highlight(bool propval)Set `highlight` property. Params: propval = Highlight the search occurrences. Returns: Builder instance for fluent chainingT matchStyle(gtksource.style.Style propval)Set `matchStyle` property. Params: propval = A #GtkSourceStyle, or null for theme's scheme default style. Returns: Builder instance for fluent chainingT settings(gtksource.search_settings.SearchSettings propval)Set `settings` property. Params: propval = The #GtkSourceSearchSettings associated to the search context.Fluent builder for [gtksource.search_context.SearchContext]
Methods