def test_filter_text(line_start, line_end, expected_text): with mock.patch('meld.meldbuffer.bind_settings', mock.DEFAULT): buf = MeldBuffer() buf.set_text(text) buffer_lines = BufferLines(buf) assert buffer_lines[line_start:line_end] == expected_text
def test_filter_text(line_start, line_end, expected_text): import meld.meldbuffer meld.meldbuffer.bind_settings = mock.MagicMock() meld.meldbuffer.meldsettings = mock.MagicMock(style_scheme=None) buf = MeldBuffer() buf.set_text(text) buffer_lines = BufferLines(buf) assert buffer_lines[line_start:line_end] == expected_text
def test_filter_text(line_start, line_end, expected_text): import meld.meldbuffer meld.meldbuffer.bind_settings = mock.MagicMock() meld.meldbuffer.meldsettings = mock.MagicMock(style_scheme=None) buf = MeldBuffer() buf.set_text(text) buffer_lines = BufferLines(buf) assert buffer_lines[line_start:line_end] == expected_text
def __init__(self, *args, **kwargs): super(MeldSourceView, self).__init__(*args, **kwargs) binding_set = Gtk.binding_set_find('GtkSourceView') for key, modifiers in self.replaced_entries: Gtk.binding_entry_remove(binding_set, key, modifiers) self.anim_source_id = None self.animating_chunks = [] self.syncpoints = [] self._show_line_numbers = None buf = MeldBuffer() buf.create_tag("inline") buf.create_tag("dimmed") self.set_buffer(buf) meldsettings.connect('changed', self.on_setting_changed)
def __init__(self, *args, **kwargs): super(MeldSourceView, self).__init__(*args, **kwargs) binding_set = Gtk.binding_set_find("GtkSourceView") for key, modifiers in self.replaced_entries: Gtk.binding_entry_remove(binding_set, key, modifiers) self.anim_source_id = None self.animating_chunks = [] self.syncpoints = [] self._show_line_numbers = None buf = MeldBuffer() buf.create_tag("inline") buf.create_tag("dimmed") self.set_buffer(buf) meldsettings.connect("changed", self.on_setting_changed) self.on_setting_changed(meldsettings, "font") self.on_setting_changed(meldsettings, "style-scheme")
def __init__(self, *args, **kwargs): super(MeldSourceView, self).__init__(*args, **kwargs) binding_set = Gtk.binding_set_find('GtkSourceView') for key, modifiers in self.replaced_entries: Gtk.binding_entry_remove(binding_set, key, modifiers) self.anim_source_id = None self.animating_chunks = [] self.syncpoints = [] self._show_line_numbers = None buf = MeldBuffer() inline_tag = GtkSource.Tag.new("inline") inline_tag.props.draw_spaces = True buf.get_tag_table().add(inline_tag) buf.create_tag("dimmed") self.set_buffer(buf) meldsettings.connect('changed', self.on_setting_changed)
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.drag_dest_add_uri_targets() # Most bindings are on SourceView, except the Page Up/Down ones # which are on TextView. binding_set_names = ('GtkSourceView', 'GtkTextView') for set_name in binding_set_names: binding_set = Gtk.binding_set_find(set_name) for key, modifiers in self.replaced_entries: Gtk.binding_entry_remove(binding_set, key, modifiers) self.anim_source_id = None self.animating_chunks = [] self.syncpoints = [] self._show_line_numbers = None buf = MeldBuffer() inline_tag = GtkSource.Tag.new("inline") inline_tag.props.draw_spaces = True buf.get_tag_table().add(inline_tag) buf.create_tag("dimmed") self.set_buffer(buf) self.connect('notify::overscroll-num-lines', self.notify_overscroll)
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.drag_dest_add_uri_targets() binding_set = Gtk.binding_set_find('GtkSourceView') for key, modifiers in self.replaced_entries: Gtk.binding_entry_remove(binding_set, key, modifiers) self.anim_source_id = None self.animating_chunks = [] self.syncpoints = [] self._show_line_numbers = None buf = MeldBuffer() inline_tag = GtkSource.Tag.new("inline") inline_tag.props.draw_spaces = True buf.get_tag_table().add(inline_tag) buf.create_tag("dimmed") self.set_buffer(buf)
def buffer_setup(): buf = MeldBuffer() buf.set_text(text) buffer_lines = BufferLines(buf) yield buf, buffer_lines