Class: GtkSource::View

Inherits:
Gtk::TextView show all
Extended by:
GLib::Deprecatable
Defined in:
lib/gtksourceview4/deprecated.rb

Direct Known Subclasses

Map

Instance Method Summary collapse

Methods inherited from Gtk::TextView

#accepts_tab, #accepts_tab=, #accepts_tab?, #add_child_at_anchor, #add_overlay, #backward_display_line, #backward_display_line_start, #bottom_margin, #bottom_margin=, #buffer, #buffer=, #buffer_to_window_coords, #cursor_visible, #cursor_visible=, #cursor_visible?, #editable, #editable=, #editable?, #extra_menu, #extra_menu=, #forward_display_line, #forward_display_line_end, #get_cursor_locations, #get_iter_at_location, #get_iter_at_position, #get_iter_location, #get_line_at_y, #get_line_yrange, #get_visible_rect, #im_context_filter_keypress, #im_module, #im_module=, #indent, #indent=, #input_hints, #input_hints=, #input_purpose, #input_purpose=, #justification, #justification=, #left_margin, #left_margin=, #ltr_context, #monospace, #monospace=, #monospace?, #move_mark_onscreen, #move_overlay, #move_visually, #overwrite, #overwrite=, #overwrite?, #pixels_above_lines, #pixels_above_lines=, #pixels_below_lines, #pixels_below_lines=, #pixels_inside_wrap, #pixels_inside_wrap=, #place_cursor_onscreen, #remove, #reset_cursor_blink, #reset_im_context, #right_margin, #right_margin=, #rtl_context, #scroll_mark_onscreen, #scroll_to_iter, #scroll_to_mark, #set_gutter, #starts_display_line, #tabs, #tabs=, #top_margin, #top_margin=, #window_to_buffer_coords, #wrap_mode, #wrap_mode=

Methods inherited from Gtk::Widget

#accessible_role, #accessible_role=, #action_set_enabled, #activate, #activate_action, #activate_action_variant, #activate_default, #activate_signal, #activate_signal=, #activate_signal_from_name=, #add_binding, #add_binding_action, #add_binding_signal, #add_controller, #add_css_class, #add_mnemonic_label, #add_shortcut, #add_tick_callback, #allocate, #allocated_baseline, #allocated_height, #allocated_width, #baseline, #bind_template_callback_full, #bind_template_child_full, #can_focus, #can_focus=, #can_focus?, #can_target, #can_target=, #can_target?, #child_focus, #child_visible, #child_visible=, #clipboard, #compute_bounds, #compute_expand, #compute_point, #compute_transform, #contains, #create_pango_context, #create_pango_layout, #css_classes, #css_classes=, #css_name, #css_name=, #cursor, #cursor=, #cursor_from_name=, default_direction, default_direction=, #direction, #direction=, #display, #dispose_template, #drag_check_threshold, #error_bell, #first_child, #focus_child, #focus_child=, #focus_on_click, #focus_on_click=, #focus_on_click?, #focusable, #focusable=, #focusable?, #font_map, #font_map=, #font_options, #font_options=, #frame_clock, #get_allocation, #get_ancestor, #get_color, #get_preferred_size, #get_size, #get_size_request, #get_template_child, #grab_focus, #halign, #halign=, #has_css_class, #has_default, #has_default=, #has_default?, #has_focus, #has_focus=, #has_focus?, #has_tooltip, #has_tooltip=, #has_tooltip?, #has_visible_focus, #height, #height_request, #height_request=, #hexpand, #hexpand=, #hexpand?, #hexpand_set, #hexpand_set=, #hexpand_set?, #hide, #in_destruction, #init_template, #insert_action_group, #insert_after, #insert_before, #install_action, #install_property_action, #is_ancestor, #is_drawable, #is_focus, #is_sensitive, #is_visible, #keynav_failed, #last_child, #layout_manager, #layout_manager=, #layout_manager_type, #layout_manager_type=, #list_mnemonic_labels, #map, #mapped, #margin_bottom, #margin_bottom=, #margin_end, #margin_end=, #margin_start, #margin_start=, #margin_top, #margin_top=, #measure, #mnemonic_activate, #name, #name=, #native, #next_sibling, #observe_children, #observe_controllers, #opacity, #opacity=, #overflow, #overflow=, #pango_context, #parent, #parent=, #pick, #prev_sibling, #primary_clipboard, #query_action, #queue_allocate, #queue_draw, #queue_resize, #realize, #realized, #receives_default, #receives_default=, #receives_default?, #remove_controller, #remove_css_class, #remove_mnemonic_label, #remove_tick_callback, #request_mode, #root, #root=, #scale_factor, #scale_factor=, #sensitive, #sensitive=, #sensitive?, #set_size_request, #set_state_flags, #settings, #should_layout, #show, #size_allocate, #snapshot_child, #state_flags, #style_context, #template=, #template_from_resource=, #template_scope=, #tooltip_markup, #tooltip_markup=, #tooltip_text, #tooltip_text=, #translate_coordinates, #trigger_tooltip_query, #unmap, #unparent, #unrealize, #unset_state_flags, #valign, #valign=, #vexpand, #vexpand=, #vexpand?, #vexpand_set, #vexpand_set=, #vexpand_set?, #visible, #visible=, #visible?, #width, #width_request, #width_request=

Constructor Details

#initialize(buffer) ⇒ Gtk::Widget

Creates a new Gtk::SourceView widget displaying the buffer buffer.

One buffer can be shared among many widgets.

Parameters:

Instance Method Details

#auto_indentBoolean

Returns whether auto-indentation of text is enabled.

Returns:

  • (Boolean)

    true if auto indentation is enabled.

#auto_indent=(auto_indent) ⇒ Boolean

Parameters:

  • auto_indent (Boolean)

Returns:

  • (Boolean)

    auto-indent

  • (Boolean)

    auto-indent

#auto_indent?Boolean

Returns auto-indent.

Returns:

  • (Boolean)

    auto-indent

#background_patternGtkSource::BackgroundPatternType

Draw a specific background pattern on the view.

Returns:

#background_pattern=(background_pattern) ⇒ GtkSource::BackgroundPatternType

Draw a specific background pattern on the view.

Parameters:

Returns:

#completionGtkSource::Completion

The completion object associated with the view

Returns:

#completion=(completion) ⇒ GtkSource::Completion

The completion object associated with the view

Parameters:

Returns:

#enable_snippetsBoolean

Gets the [propertyView:enable-snippets] property.

If true, matching snippets found in the [classSnippetManager] may be expanded when the user presses Tab after a word in the [classView].

Returns:

  • (Boolean)

    true if enabled

#enable_snippets=(enable_snippets) ⇒ Boolean

The property denotes if snippets should be expanded when the user presses Tab after having typed a word matching the snippets found in [classSnippetManager].

The user may tab through focus-positions of the snippet if any are available by pressing Tab repeatedly until the desired focus position is selected.

Parameters:

  • enable_snippets (Boolean)

Returns:

  • (Boolean)

    enable-snippets

  • (Boolean)

    enable-snippets

#enable_snippets?Boolean

The property denotes if snippets should be expanded when the user presses Tab after having typed a word matching the snippets found in [classSnippetManager].

The user may tab through focus-positions of the snippet if any are available by pressing Tab repeatedly until the desired focus position is selected.

Returns:

  • (Boolean)

    enable-snippets

#get_gutter(window_type) ⇒ GtkSource::Gutter

Returns the [classGutter] object associated with window_type for view.

Only %GTK_TEXT_WINDOW_LEFT and %GTK_TEXT_WINDOW_RIGHT are supported, respectively corresponding to the left and right gutter. The line numbers and mark category icons are rendered in the left gutter.

Parameters:

Returns:

#get_mark_attributes(category, priority) ⇒ GtkSource::MarkAttributes

Gets attributes and priority for the category. The object belongs to view, so it must not be unreffed.

Parameters:

  • category (String)

    the category.

  • priority (Integer)

    place where priority of the category will be stored.

Returns:

#get_visual_column(iter) ⇒ Integer

Determines the visual column at iter taking into consideration the [propertyView:tab-width] of view.

Parameters:

  • iter (Gtk::TextIter)

    a position in view.

Returns:

  • (Integer)

    the visual column at iter.

#highlight_current_lineBoolean

Returns whether the current line is highlighted.

Returns:

  • (Boolean)

    true if the current line is highlighted.

#highlight_current_line=(highlight_current_line) ⇒ Boolean

Parameters:

  • highlight_current_line (Boolean)

Returns:

  • (Boolean)

    highlight-current-line

  • (Boolean)

    highlight-current-line

#highlight_current_line?Boolean

Returns highlight-current-line.

Returns:

  • (Boolean)

    highlight-current-line

#hoverGtkSource::Hover

Gets the [classHover] associated with view.

The returned object is guaranteed to be the same for the lifetime of view. Each [classView] object has a different [classHover].

Returns:

#indent_lines(start, end) ⇒ nil

Inserts one indentation level at the beginning of the specified lines. The empty lines are not indented.

Parameters:

  • start (Gtk::TextIter)

    Gtk::TextIter of the first line to indent

  • end (Gtk::TextIter)

    Gtk::TextIter of the last line to indent

Returns:

  • (nil)

#indent_on_tabBoolean

Returns whether when the tab key is pressed the current selection should get indented instead of replaced with the \t character.

Returns:

  • (Boolean)

    true if the selection is indented when tab is pressed.

#indent_on_tab=(indent_on_tab) ⇒ Boolean

Parameters:

  • indent_on_tab (Boolean)

Returns:

  • (Boolean)

    indent-on-tab

  • (Boolean)

    indent-on-tab

#indent_on_tab?Boolean

Returns indent-on-tab.

Returns:

  • (Boolean)

    indent-on-tab

#indent_widthInteger

Width of an indentation step expressed in number of spaces.

Returns:

  • (Integer)

    indent-width

#indent_width=(indent_width) ⇒ Integer

Width of an indentation step expressed in number of spaces.

Parameters:

  • indent_width (Integer)

Returns:

  • (Integer)

    indent-width

  • (Integer)

    indent-width

#indenterGtkSource::Indenter

The property is a [ifaceIndenter] to use to indent as the user types into the [classView].

Returns:

#indenter=(indenter) ⇒ GtkSource::Indenter

The property is a [ifaceIndenter] to use to indent as the user types into the [classView].

Parameters:

Returns:

#insert_spaces_instead_of_tabsBoolean

Returns whether when inserting a tabulator character it should be replaced by a group of space characters.

Returns:

  • (Boolean)

    true if spaces are inserted instead of tabs.

#insert_spaces_instead_of_tabs=(insert_spaces_instead_of_tabs) ⇒ Boolean

Parameters:

  • insert_spaces_instead_of_tabs (Boolean)

Returns:

  • (Boolean)

    insert-spaces-instead-of-tabs

  • (Boolean)

    insert-spaces-instead-of-tabs

#insert_spaces_instead_of_tabs?Boolean

Returns insert-spaces-instead-of-tabs.

Returns:

  • (Boolean)

    insert-spaces-instead-of-tabs

#push_snippet(snippet, location) ⇒ nil

Inserts a new snippet at location

If another snippet was already active, it will be paused and the new snippet will become active. Once the focus positions of snippet have been exhausted, editing will return to the previous snippet.

Parameters:

  • snippet (GtkSource::Snippet)

    a Gtk::SourceSnippet

  • location (Gtk::TextIter)

    a Gtk::TextIter or nil for the cursor position

Returns:

  • (nil)

#right_margin_positionInteger

Position of the right margin.

Returns:

  • (Integer)

    right-margin-position

#right_margin_position=(right_margin_position) ⇒ Integer

Position of the right margin.

Parameters:

  • right_margin_position (Integer)

Returns:

  • (Integer)

    right-margin-position

  • (Integer)

    right-margin-position

#set_mark_attributes(category, attributes, priority) ⇒ nil

Sets attributes and priority for the category.

Parameters:

  • category (String)

    the category.

  • attributes (GtkSource::MarkAttributes)

    mark attributes.

  • priority (Integer)

    priority of the category.

Returns:

  • (nil)

#show_line_marksBoolean

Returns whether line marks are displayed beside the text.

Returns:

  • (Boolean)

    true if the line marks are displayed.

#show_line_marks=(show_line_marks) ⇒ Boolean

Whether to display line mark pixbufs

Parameters:

  • show_line_marks (Boolean)

Returns:

  • (Boolean)

    show-line-marks

  • (Boolean)

    show-line-marks

#show_line_marks?Boolean

Whether to display line mark pixbufs

Returns:

  • (Boolean)

    show-line-marks

#show_line_numbersBoolean

Returns whether line numbers are displayed beside the text.

Returns:

  • (Boolean)

    true if the line numbers are displayed.

#show_line_numbers=(show_line_numbers) ⇒ Boolean

Whether to display line numbers

Parameters:

  • show_line_numbers (Boolean)

Returns:

  • (Boolean)

    show-line-numbers

  • (Boolean)

    show-line-numbers

#show_line_numbers?Boolean

Whether to display line numbers

Returns:

  • (Boolean)

    show-line-numbers

#show_right_marginBoolean

Returns whether a right margin is displayed.

Returns:

  • (Boolean)

    true if the right margin is shown.

#show_right_margin=(show_right_margin) ⇒ Boolean

Whether to display the right margin.

Parameters:

  • show_right_margin (Boolean)

Returns:

  • (Boolean)

    show-right-margin

  • (Boolean)

    show-right-margin

#show_right_margin?Boolean

Whether to display the right margin.

Returns:

  • (Boolean)

    show-right-margin

#smart_backspaceBoolean

Returns true if pressing the Backspace key will try to delete spaces up to the previous tab stop.

Returns:

  • (Boolean)

    true if smart Backspace handling is enabled.

#smart_backspace=(smart_backspace) ⇒ Boolean

Whether smart Backspace should be used.

Parameters:

  • smart_backspace (Boolean)

Returns:

  • (Boolean)

    smart-backspace

  • (Boolean)

    smart-backspace

#smart_backspace?Boolean

Whether smart Backspace should be used.

Returns:

  • (Boolean)

    smart-backspace

#smart_home_endGtkSource::SmartHomeEndType

Set the behavior of the HOME and END keys.

Returns:

#smart_home_end=(smart_home_end) ⇒ GtkSource::SmartHomeEndType

Set the behavior of the HOME and END keys.

Parameters:

Returns:

#space_drawerGtkSource::SpaceDrawer

The [classSpaceDrawer] object associated with the view.4

Returns:

#space_drawer=(space_drawer) ⇒ GtkSource::SpaceDrawer

The [classSpaceDrawer] object associated with the view.4

Parameters:

Returns:

#tab_widthInteger

Width of a tab character expressed in number of spaces.

Returns:

  • (Integer)

    tab-width

#tab_width=(tab_width) ⇒ Integer

Width of a tab character expressed in number of spaces.

Parameters:

  • tab_width (Integer)

Returns:

  • (Integer)

    tab-width

  • (Integer)

    tab-width

#unindent_lines(start, end) ⇒ nil

Removes one indentation level at the beginning of the specified lines.

Parameters:

  • start (Gtk::TextIter)

    Gtk::TextIter of the first line to indent

  • end (Gtk::TextIter)

    Gtk::TextIter of the last line to indent

Returns:

  • (nil)