# Path: draobpilc/common.py
# APPLICATION = None
# SETTINGS_SCHEMA_ID = version.APP_ID
# SETTINGS_SCHEMA_DIR = get_data_path('schemas')
# SETTINGS = utils.get_settings(
#     SETTINGS_SCHEMA_ID,
#     SETTINGS_SCHEMA_DIR
# )
# ICON_PATH = get_data_path('draobpilc.png')
# CSS_PATH = get_data_path('style.css')
# WIDTH_PERCENTS = 'width-percents'
# PROCESSOR_WIDTH_PERCENTS = 'processor-width-percents'
# PROCESSOR_HEIGHT_PERCENTS = 'processor-height-percents'
# ITEM_MAX_LINES = 'item-max-lines'
# ITEM_MAX_HEIGHT = 'item-max-height'
# KIND_INDICATOR_WIDTH = 'kind-indicator-width'
# ITEM_PREVIEW_MARGIN = 'item-preview-margin'
# EDIT_TIMEOUT_MS = 'edit-timeout-ms'
# SHOW_INDEXES = 'show-indexes'
# SEARCH_TIMEOUT = 'search-timeout'
# FUZZY_SEARCH_MAX_DISTANCE = 'fuzzy-search-max-distance'
# STARTUP_NOTIFICATION = 'startup-notification'
# MERGE_DECORATORS = 'merge-decorators'
# MERGE_SEPARATORS = 'merge-separators'
# MERGE_DEFAULT_DECORATOR = 'merge-default-decorator'
# MERGE_DEFAULT_SEPARATOR = 'merge-default-separator'
# GPASTE_SCHEMA_ID = 'gpaste-schema-id'
# GPASTE_DBUS_NAME = 'gpaste-dbus-name'
# GPASTE_DBUS_PATH = 'gpaste-dbus-path'
# GPASTE_DBUS_IFACE = 'gpaste-dbus-iface'
# SHOW_TEXT_INFO = 'show-text-info'
# SHOW_HISTORIES = 'show-histories'
# DELETE_ITEM = 'delete-item'
# SHOW_THUMBNAILS = 'show-thumbnails'
# FOCUS_SEARCH = 'focus-search'
# RESET_SEARCH = 'reset-search'
# EDITOR_WRAP_TEXT = 'editor-wrap-text'
# EDITOR_WRAP_TEXT_SHORTCUT = 'editor-wrap-text-shortcut'
# OPEN_ITEM = 'open-item'
# BACKUP_HISTORY = 'backup-history'
# PREVIEW_TEXT_FILES = 'preview-text-files'
# KEEP_SEARCH_AND_CLOSE = 'keep-search-and-close'
# HIDE_APP = 'hide-app'
# QUIT_APP = 'quit-app'
# FOCUS_SEARCH_ON_OPEN = 'focus-search-on-open'
# SET_ITEMS_TIMEOUT = 'set-items-timeout'
# MAX_FILTER_RESULTS = 'max-filter-results'
# SHOW_HELP = 'show-help'
# SHOW_CLIPBOARD_PREVIEW = 'show-clipboard-preview'
# ITEMS_VIEW_LIMIT = 'items-view-limit'
# LOAD_ALL_HISTORY = 'load-all-history'
# ENABLE_ACTIVATE_NUMBER_KB = 'enable-activate-number-kb'
# SHORTCUTS_KEYS = {
#     SHOW_HISTORIES: _('Show histories'),
#     DELETE_ITEM: _('Delete an item'),
#     FOCUS_SEARCH: _('Focus search entry'),
#     RESET_SEARCH: _('Reset search'),
#     EDITOR_WRAP_TEXT_SHORTCUT: _('Toggle text wrap in the editor'),
#     OPEN_ITEM: _('Open selected item(file, image, url)'),
#     BACKUP_HISTORY: _('Backup current history'),
#     KEEP_SEARCH_AND_CLOSE: _('Keep search and close window'),
#     QUIT_APP: _('Quit app'),
#     SHOW_HELP: _('Show help'),
#     SHOW_CLIPBOARD_PREVIEW: _('Show clipboard preview'),
#     LOAD_ALL_HISTORY: _('Load all history')
# }


from gi import require_version
from gi.repository import Gtk
from gi.repository import GLib
from gi.repository import GObject
    from gi.repository import GtkSource
from draobpilc import common
            lambda b: self._update_wrap_mode()
        )

        self.window = Gtk.ScrolledWindow()
        self.window.add(self.textview)
        self.window.set_margin_bottom(TextWindow.MARGIN)
        self.window.set_margin_left(TextWindow.MARGIN)
        self.window.set_margin_right(TextWindow.MARGIN)

        self.add(self.window)
        self.add_overlay(self._wrap_mode_btn)
        self.show_all()

        common.SETTINGS.connect(
            'changed::' + common.EDITOR_WRAP_TEXT,
            lambda s, k: self._wrap_mode_btn.set_active(s[k])
        )
        self._update_wrap_mode()

    def _on_text_changed(self, buffer):
        def on_timeout():
            self._timeout_id = 0
            self.emit('changed', buffer)
            return GLib.SOURCE_REMOVE

        if self._timeout_id:
            GLib.source_remove(self._timeout_id)
            self._timeout_id = 0

        self._timeout_id = GLib.timeout_add(

# Path: draobpilc/common.py
# APPLICATION = None
# SETTINGS_SCHEMA_ID = version.APP_ID
# SETTINGS_SCHEMA_DIR = get_data_path('schemas')
# SETTINGS = utils.get_settings(
#     SETTINGS_SCHEMA_ID,
#     SETTINGS_SCHEMA_DIR
# )
# ICON_PATH = get_data_path('draobpilc.png')
# CSS_PATH = get_data_path('style.css')
# WIDTH_PERCENTS = 'width-percents'
# PROCESSOR_WIDTH_PERCENTS = 'processor-width-percents'
# PROCESSOR_HEIGHT_PERCENTS = 'processor-height-percents'
# ITEM_MAX_LINES = 'item-max-lines'
# ITEM_MAX_HEIGHT = 'item-max-height'
# KIND_INDICATOR_WIDTH = 'kind-indicator-width'
# ITEM_PREVIEW_MARGIN = 'item-preview-margin'
# EDIT_TIMEOUT_MS = 'edit-timeout-ms'
# SHOW_INDEXES = 'show-indexes'
# SEARCH_TIMEOUT = 'search-timeout'
# FUZZY_SEARCH_MAX_DISTANCE = 'fuzzy-search-max-distance'
# STARTUP_NOTIFICATION = 'startup-notification'
# MERGE_DECORATORS = 'merge-decorators'
# MERGE_SEPARATORS = 'merge-separators'
# MERGE_DEFAULT_DECORATOR = 'merge-default-decorator'
# MERGE_DEFAULT_SEPARATOR = 'merge-default-separator'
# GPASTE_SCHEMA_ID = 'gpaste-schema-id'
# GPASTE_DBUS_NAME = 'gpaste-dbus-name'
# GPASTE_DBUS_PATH = 'gpaste-dbus-path'
# GPASTE_DBUS_IFACE = 'gpaste-dbus-iface'
# SHOW_TEXT_INFO = 'show-text-info'
# SHOW_HISTORIES = 'show-histories'
# DELETE_ITEM = 'delete-item'
# SHOW_THUMBNAILS = 'show-thumbnails'
# FOCUS_SEARCH = 'focus-search'
# RESET_SEARCH = 'reset-search'
# EDITOR_WRAP_TEXT = 'editor-wrap-text'
# EDITOR_WRAP_TEXT_SHORTCUT = 'editor-wrap-text-shortcut'
# OPEN_ITEM = 'open-item'
# BACKUP_HISTORY = 'backup-history'
# PREVIEW_TEXT_FILES = 'preview-text-files'
# KEEP_SEARCH_AND_CLOSE = 'keep-search-and-close'
# HIDE_APP = 'hide-app'
# QUIT_APP = 'quit-app'
# FOCUS_SEARCH_ON_OPEN = 'focus-search-on-open'
# SET_ITEMS_TIMEOUT = 'set-items-timeout'
# MAX_FILTER_RESULTS = 'max-filter-results'
# SHOW_HELP = 'show-help'
# SHOW_CLIPBOARD_PREVIEW = 'show-clipboard-preview'
# ITEMS_VIEW_LIMIT = 'items-view-limit'
# LOAD_ALL_HISTORY = 'load-all-history'
# ENABLE_ACTIVATE_NUMBER_KB = 'enable-activate-number-kb'
# SHORTCUTS_KEYS = {
#     SHOW_HISTORIES: _('Show histories'),
#     DELETE_ITEM: _('Delete an item'),
#     FOCUS_SEARCH: _('Focus search entry'),
#     RESET_SEARCH: _('Reset search'),
#     EDITOR_WRAP_TEXT_SHORTCUT: _('Toggle text wrap in the editor'),
#     OPEN_ITEM: _('Open selected item(file, image, url)'),
#     BACKUP_HISTORY: _('Backup current history'),
#     KEEP_SEARCH_AND_CLOSE: _('Keep search and close window'),
#     QUIT_APP: _('Quit app'),
#     SHOW_HELP: _('Show help'),
#     SHOW_CLIPBOARD_PREVIEW: _('Show clipboard preview'),
#     LOAD_ALL_HISTORY: _('Load all history')
# }


# Path: draobpilc/processors/processor_textwindow.py
from gi import require_version
from gi.repository import Gtk
from gi.repository import GLib
from gi.repository import GObject
    from gi.repository import GtkSource
from draobpilc import common

            lambda b: self._update_wrap_mode()
        )

        self.window = Gtk.ScrolledWindow()
        self.window.add(self.textview)
        self.window.set_margin_bottom(TextWindow.MARGIN)
        self.window.set_margin_left(TextWindow.MARGIN)
        self.window.set_margin_right(TextWindow.MARGIN)

        self.add(self.window)
        self.add_overlay(self._wrap_mode_btn)
        self.show_all()

        common.SETTINGS.connect(
            'changed::' + common.EDITOR_WRAP_TEXT,
            lambda s, k: self._wrap_mode_btn.set_active(s[k])
        )
        self._update_wrap_mode()

    def _on_text_changed(self, buffer):
        def on_timeout():
            self._timeout_id = 0
            self.emit('changed', buffer)
            return GLib.SOURCE_REMOVE

        if self._timeout_id:
            GLib.source_remove(self._timeout_id)
            self._timeout_id = 0

        self._timeout_id = GLib.timeout_add(

            common.SETTINGS[common.EDIT_TIMEOUT_MS],