Class: GtkSource::Buffer
- Inherits:
-
Gtk::TextBuffer
- Object
- Gtk::TextBuffer
- GtkSource::Buffer
- Extended by:
- GLib::Deprecatable
- Defined in:
- lib/gtksourceview4/deprecated.rb
Instance Method Summary collapse
-
#backward_iter_to_source_mark(iter, category) ⇒ Boolean
Moves
iterto the position of the previous [classMark] of the given category. -
#change_case(case_type, start, end) ⇒ nil
Changes the case of the text between the specified iterators.
-
#create_source_mark(name, category, where) ⇒ GtkSource::Mark
Creates a source mark in the
bufferof categorycategory. -
#create_source_tag(tag_name, first_property_name, array) ⇒ Gtk::TextTag
In short, this is the same function as [methodGtk.TextBuffer.create_tag] but instead of creating a [classGtk.TextTag], this function creates a [classTag].
-
#ensure_highlight(start, end) ⇒ nil
Forces buffer to analyze and highlight the given area synchronously.
-
#forward_iter_to_source_mark(iter, category) ⇒ Boolean
Moves
iterto the position of the next [classMark] of the givencategory. -
#get_context_classes_at_iter(iter) ⇒ Array<String>
Get all defined context classes at iter.
-
#get_source_marks_at_iter(iter, category) ⇒ GLib::SList<GtkSource::Mark>
Returns the list of marks of the given category at iter.
-
#get_source_marks_at_line(line, category) ⇒ GLib::SList<GtkSource::Mark>
Returns the list of marks of the given category at line.
-
#highlight_matching_brackets ⇒ Boolean
Determines whether bracket match highlighting is activated for the source buffer.
-
#highlight_matching_brackets=(highlight_matching_brackets) ⇒ Boolean
Whether to highlight matching brackets in the buffer.
-
#highlight_matching_brackets? ⇒ Boolean
Whether to highlight matching brackets in the buffer.
-
#highlight_syntax ⇒ Boolean
Determines whether syntax highlighting is activated in the source buffer.
-
#highlight_syntax=(highlight_syntax) ⇒ Boolean
Whether to highlight syntax in the buffer.
-
#highlight_syntax? ⇒ Boolean
Whether to highlight syntax in the buffer.
-
#implicit_trailing_newline ⇒ Boolean
Whether the buffer has an implicit trailing newline.
-
#implicit_trailing_newline=(implicit_trailing_newline) ⇒ Boolean
Whether the buffer has an implicit trailing newline.
-
#implicit_trailing_newline? ⇒ Boolean
Whether the buffer has an implicit trailing newline.
-
#initialize(language) ⇒ GtkSource::Buffer
constructor
Creates a new source buffer using the highlighting patterns in
language. -
#iter_backward_to_context_class_toggle(iter, context_class) ⇒ Boolean
Moves backward to the next toggle (on or off) of the context class.
-
#iter_forward_to_context_class_toggle(iter, context_class) ⇒ Boolean
Moves forward to the next toggle (on or off) of the context class.
-
#iter_has_context_class(iter, context_class) ⇒ Boolean
Check if the class context_class is set on iter.
-
#join_lines(start, end) ⇒ nil
Joins the lines of text between the specified iterators.
-
#language ⇒ GtkSource::Language
Language.
- #language=(language) ⇒ GtkSource::Language
- #loading ⇒ Boolean
-
#loading=(loading) ⇒ Boolean
The "loading" property denotes that a
GtkSourceFileLoaderis currently loading the buffer. -
#loading? ⇒ Boolean
The "loading" property denotes that a
GtkSourceFileLoaderis currently loading the buffer. -
#remove_source_marks(start, end, category) ⇒ nil
Remove all marks of category between start and end from the buffer.
-
#sort_lines(start, end, flags, column) ⇒ nil
Sort the lines of text between the specified iterators.
-
#style_scheme ⇒ GtkSource::StyleScheme
Style scheme.
-
#style_scheme=(style_scheme) ⇒ GtkSource::StyleScheme
Style scheme.
Methods inherited from Gtk::TextBuffer
#add_mark, #add_selection_clipboard, #apply_tag, #apply_tag_by_name, #backspace, #begin_irreversible_action, #begin_user_action, #can_redo, #can_redo=, #can_redo?, #can_undo, #can_undo=, #can_undo?, #char_count, #copy_clipboard, #create_child_anchor, #create_mark, #create_tag, #cursor_position, #cursor_position=, #cut_clipboard, #delete, #delete_interactive, #delete_mark, #delete_mark_by_name, #delete_selection, #enable_undo, #enable_undo=, #enable_undo?, #end_irreversible_action, #end_user_action, #get_bounds, #get_end_iter, #get_iter_at_child_anchor, #get_iter_at_line, #get_iter_at_line_index, #get_iter_at_line_offset, #get_iter_at_mark, #get_iter_at_offset, #get_mark, #get_selection_bounds, #get_slice, #get_start_iter, #get_text, #has_selection, #has_selection=, #has_selection?, #insert, #insert_at_cursor, #insert_child_anchor, #insert_interactive, #insert_interactive_at_cursor, #insert_markup, #insert_paintable, #insert_range, #insert_range_interactive, #insert_with_tags, #insert_with_tags_by_name, #line_count, #max_undo_levels, #max_undo_levels=, #modified, #modified=, #move_mark, #move_mark_by_name, #paste_clipboard, #place_cursor, #redo, #remove_all_tags, #remove_selection_clipboard, #remove_tag, #remove_tag_by_name, #select_range, #selection_bound, #selection_content, #set_text, #tag_table, #tag_table=, #text, #text=, #undo
Constructor Details
#initialize(language) ⇒ GtkSource::Buffer
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 [methodBuffer.set_language].
according to the highlighting patterns in language.
Instance Method Details
#backward_iter_to_source_mark(iter, category) ⇒ Boolean
Moves iter to the position of the previous [classMark] of the given
category.
Returns true if iter was moved. If category is NULL, the
previous source mark can be of any category.
#change_case(case_type, start, end) ⇒ nil
Changes the case of the text between the specified iterators.
Since 5.4, this function will update the position of start and
end to surround the modified text.
#create_source_mark(name, category, where) ⇒ GtkSource::Mark
Creates a source mark in the buffer of category category.
A source mark is a [classGtk.TextMark] but organized into categories. Depending on the category a pixbuf can be specified that will be displayed along the line of the mark.
Like a [classGtk.TextMark], a [classMark] can be anonymous if the
passed name is nil. 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..
#create_source_tag(tag_name, first_property_name, array) ⇒ Gtk::TextTag
In short, this is the same function as [methodGtk.TextBuffer.create_tag] but instead of creating a [classGtk.TextTag], this function creates a [classTag].
This function creates a [classTag] and adds it to the tag table for
buffer. Equivalent to calling [ctorGtk.TextTag.new] and then adding the tag to
the buffer’s tag table. The returned tag is owned by the buffer’s tag table,
so the ref count will be equal to one.
If tag_name is nil, the tag is anonymous.
If tag_name is non-nil, a tag called tag_name must not already
exist in the tag table for this buffer.
The first_property_name argument and subsequent arguments are a list
of properties to set on the tag, as with [methodGObject.Object.set].
#ensure_highlight(start, end) ⇒ nil
Forces buffer to analyze and highlight the given area synchronously.
Note:
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.
#forward_iter_to_source_mark(iter, category) ⇒ Boolean
Moves iter to the position of the next [classMark] of the given
category.
Returns true if iter was moved. If category is NULL, the
next source mark can be of any category.
#get_context_classes_at_iter(iter) ⇒ Array<String>
Get all defined context classes at iter.
See the [classBuffer] description for the list of default context classes. terminated array of context class names. Use g_strfreev() to free the array if it is no longer needed.
#get_source_marks_at_iter(iter, category) ⇒ GLib::SList<GtkSource::Mark>
Returns the list of marks of the given category at iter.
If category is nil it returns all marks at iter. a newly allocated #GSList.
#get_source_marks_at_line(line, category) ⇒ GLib::SList<GtkSource::Mark>
Returns the list of marks of the given category at line.
If category is nil, all marks at line are returned. a newly allocated #GSList.
#highlight_matching_brackets ⇒ Boolean
Determines whether bracket match highlighting is activated for the source buffer. brackets.
#highlight_matching_brackets=(highlight_matching_brackets) ⇒ Boolean
Whether to highlight matching brackets in the buffer.
#highlight_matching_brackets? ⇒ Boolean
Whether to highlight matching brackets in the buffer.
#highlight_syntax ⇒ Boolean
Determines whether syntax highlighting is activated in the source buffer.
#highlight_syntax=(highlight_syntax) ⇒ Boolean
Whether to highlight syntax in the buffer.
#highlight_syntax? ⇒ Boolean
Whether to highlight syntax in the buffer.
#implicit_trailing_newline ⇒ Boolean
Returns whether the buffer has an implicit trailing newline.
#implicit_trailing_newline=(implicit_trailing_newline) ⇒ Boolean
Whether the buffer has an implicit trailing newline. See [methodBuffer.set_implicit_trailing_newline].
#implicit_trailing_newline? ⇒ Boolean
Whether the buffer has an implicit trailing newline. See [methodBuffer.set_implicit_trailing_newline].
#iter_backward_to_context_class_toggle(iter, context_class) ⇒ Boolean
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 [classBuffer] description for the list of default context classes.
#iter_forward_to_context_class_toggle(iter, context_class) ⇒ Boolean
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 [classBuffer] description for the list of default context classes.
#iter_has_context_class(iter, context_class) ⇒ Boolean
Check if the class context_class is set on iter.
See the [classBuffer] description for the list of default context classes.
#join_lines(start, end) ⇒ nil
Joins the lines of text between the specified iterators.
#language ⇒ GtkSource::Language
Returns language.
#language=(language) ⇒ GtkSource::Language
#loading ⇒ Boolean
#loading=(loading) ⇒ Boolean
The "loading" property denotes that a GtkSourceFileLoader is
currently loading the buffer.
Applications may want to use this setting to avoid doing work while the buffer is loading such as spellchecking.
#loading? ⇒ Boolean
The "loading" property denotes that a GtkSourceFileLoader is
currently loading the buffer.
Applications may want to use this setting to avoid doing work while the buffer is loading such as spellchecking.
#remove_source_marks(start, end, category) ⇒ nil
Remove all marks of category between start and end from the buffer.
If category is NULL, all marks in the range will be removed.
#sort_lines(start, end, flags, column) ⇒ nil
Sort the lines of text between the specified iterators.
#style_scheme ⇒ GtkSource::StyleScheme
Style scheme. It contains styles for syntax highlighting, optionally foreground, background, cursor color, current line color, and matching brackets style.
#style_scheme=(style_scheme) ⇒ GtkSource::StyleScheme
Style scheme. It contains styles for syntax highlighting, optionally foreground, background, cursor color, current line color, and matching brackets style.