# Path: meld/util/sourceviewer.py
# class _srcviewer(object):
# class _gtksourceview2(_srcviewer):
# class gtksourceview24(_gtksourceview2):
#         class SourceView(viewClass):
# class gtksourceview210(_gtksourceview2):
# class nullsourceview(_srcviewer):
#         class NullTextView(gtk.TextView):
# class MeldSourceView(srcviewer.GtkTextView):
#     def __init__(self):
#     def version_check(self):
#     def overrides(self):
#     def GtkLanguageManager(self):
#     def set_highlight_syntax(self, buf, enabled):
#     def set_tab_width(self, tab, tab_size):
#     def get_language_from_file(self, filename):
#     def get_language_from_mime_type(self, mimetype):
#     def get_language_manager(self):
#     def set_language(self, buf, lang):
#     def version_check(self):
#     def overrides(self):
#     def GtkLanguageManager(self):
#     def set_tab_width(self, tab, tab_size):
#     def set_highlight_syntax(self, buf, enabled):
#     def get_language_from_file(self, filename):
#     def get_language_from_mime_type(self, mime_type):
#     def set_language(self, buf, lang):
#     def version_check(self):
#     def overrides(self):
#             def do_key_press_event(self, event):
#     def version_check(self):
#     def overrides(self):
#     def overrides(self):
#     def version_check(self):
# def _get_srcviewer():
#     def get_y_for_line_num(self, line):
#     def get_line_num_for_y(self, y):
# 
# Path: meld/util/compat.py



import sys
from gettext import gettext as _
from .util import sourceviewer
from .util.compat import text_type
                lines.append("")
                ends.append("")

            hi = self.buf.get_line_count() if hi == sys.maxsize else hi
            if hi - lo != len(lines):
                # These codepoints are considered line breaks by Python, but
                # not by GtkTextStore.
                additional_breaks = set(('\x0c', '\x85'))
                i = 0
                while i < len(ends):
                    line, end = lines[i], ends[i]
                    # It's possible that the last line in a file would end in a
                    # line break character, which requires no joining.
                    if end and end[-1] in additional_breaks and \
                       (not line or line[-1] not in additional_breaks):
                        assert len(ends) >= i + 1
                        lines[i:i + 2] = [line + end[-1] + lines[i + 1]]
                        ends[i:i + 2] = [end + ends[i + 1]]
                    i += 1

            return lines

        elif isinstance(key, int):
            if key >= len(self):
                raise IndexError
            line_start = self.buf.get_iter_at_line_or_eof(key)
            line_end = line_start.copy()
            if not line_end.ends_line():
                line_end.forward_to_line_end()
            txt = self.buf.get_text(line_start, line_end, False)

# Path: meld/util/sourceviewer.py
# class _srcviewer(object):
# class _gtksourceview2(_srcviewer):
# class gtksourceview24(_gtksourceview2):
#         class SourceView(viewClass):
# class gtksourceview210(_gtksourceview2):
# class nullsourceview(_srcviewer):
#         class NullTextView(gtk.TextView):
# class MeldSourceView(srcviewer.GtkTextView):
#     def __init__(self):
#     def version_check(self):
#     def overrides(self):
#     def GtkLanguageManager(self):
#     def set_highlight_syntax(self, buf, enabled):
#     def set_tab_width(self, tab, tab_size):
#     def get_language_from_file(self, filename):
#     def get_language_from_mime_type(self, mimetype):
#     def get_language_manager(self):
#     def set_language(self, buf, lang):
#     def version_check(self):
#     def overrides(self):
#     def GtkLanguageManager(self):
#     def set_tab_width(self, tab, tab_size):
#     def set_highlight_syntax(self, buf, enabled):
#     def get_language_from_file(self, filename):
#     def get_language_from_mime_type(self, mime_type):
#     def set_language(self, buf, lang):
#     def version_check(self):
#     def overrides(self):
#             def do_key_press_event(self, event):
#     def version_check(self):
#     def overrides(self):
#     def overrides(self):
#     def version_check(self):
# def _get_srcviewer():
#     def get_y_for_line_num(self, line):
#     def get_line_num_for_y(self, y):
# 
# Path: meld/util/compat.py



# Path: meld/meldbuffer.py
import sys
from gettext import gettext as _
from .util import sourceviewer
from .util.compat import text_type

                lines.append("")
                ends.append("")

            hi = self.buf.get_line_count() if hi == sys.maxsize else hi
            if hi - lo != len(lines):
                # These codepoints are considered line breaks by Python, but
                # not by GtkTextStore.
                additional_breaks = set(('\x0c', '\x85'))
                i = 0
                while i < len(ends):
                    line, end = lines[i], ends[i]
                    # It's possible that the last line in a file would end in a
                    # line break character, which requires no joining.
                    if end and end[-1] in additional_breaks and \
                       (not line or line[-1] not in additional_breaks):
                        assert len(ends) >= i + 1
                        lines[i:i + 2] = [line + end[-1] + lines[i + 1]]
                        ends[i:i + 2] = [end + ends[i + 1]]
                    i += 1

            return lines

        elif isinstance(key, int):
            if key >= len(self):
                raise IndexError
            line_start = self.buf.get_iter_at_line_or_eof(key)
            line_end = line_start.copy()
            if not line_end.ends_line():
                line_end.forward_to_line_end()
            txt = self.buf.get_text(line_start, line_end, False)

            return text_type(self.textfilter(txt), 'utf8')