<commit_before>import os.path
import weakref

import gtk
import gtksourceview2

from uxie.utils import idle, join_to_file_dir, join_to_settings_dir
from uxie.plugins import Manager as PluginManager
from uxie.actions import Activator, map_generic

from ..util import lazy_property, get_project_root, save_file

from . import prefs

from .editor import Editor
from .context import add_setter as add_context_setter, Processor as ContextProcessor

import snaked.core.quick_open
import snaked.core.titler
import snaked.core.editor_list
import snaked.core.window
import snaked.core.plugins
import snaked.core.console

prefs.add_option('RESTORE_POSITION', True, 'Restore snaked windows position')
prefs.add_option('CONSOLE_FONT', 'Monospace 8', 'Font used in console panel')
prefs.add_option('MIMIC_PANEL_COLORS_TO_EDITOR_THEME', True,
                 'Try to apply editor color theme to various panels')
prefs.add_option('WINDOW_BORDER_WIDTH', 0, 'Adjust window border width if you have bad wm')
prefs.add_option('SHOW_TABS', None,
                 'State of tabs visibility. Set it to None to use window specific settings')
prefs.add_option('TAB_BAR_PLACEMENT', None,
                 '''Tab bar placement position. One of "top", "bottom", "left", "right"
                    Set it to None to use window specific settings''')

prefs.add_internal_option('WINDOWS', list)
prefs.add_internal_option('MODIFIED_FILES', dict)

map_generic('root-menu', 'F1')
map_generic('activate-search-entry', '<ctrl>s')
map_generic('escape', 'Escape')
map_generic('delete', 'Delete')

map_generic('prev', '<ctrl>Up', 1)
map_generic('next', '<ctrl>Down', 1)

map_generic('goto-definition', 'F3')
map_generic('show-outline', '<ctrl>o')
map_generic('show-calltip', '<ctrl>Return')


class EditorManager(object):
    def __init__(self, session):
        self.buffers = []
        self.windows = []

        self.session = session
        self.style_manager = gtksourceview2.style_scheme_manager_get_default()
        self.lang_manager = gtksourceview2.language_manager_get_default()
        self.modify_lang_search_path(self.lang_manager)

        self.activator = Activator()
        self.activator.add_context('manager', (), lambda: self)
        self.activator.bind_accel('manager', 'quit', '_File/$_Quit', '<ctrl>q', EditorManager.quit)

        self.plugin_manager = PluginManager(self.activator)

        self.init_conf()<commit_msg>fix: show-outline generic shortcut was overrided by gtksourceview<commit_after>import os.path
import weakref

import gtk
import gtksourceview2

from uxie.utils import idle, join_to_file_dir, join_to_settings_dir
from uxie.plugins import Manager as PluginManager
from uxie.actions import Activator, map_generic

from ..util import lazy_property, get_project_root, save_file

from . import prefs

from .editor import Editor
from .context import add_setter as add_context_setter, Processor as ContextProcessor

import snaked.core.quick_open
import snaked.core.titler
import snaked.core.editor_list
import snaked.core.window
import snaked.core.plugins
import snaked.core.console

prefs.add_option('RESTORE_POSITION', True, 'Restore snaked windows position')
prefs.add_option('CONSOLE_FONT', 'Monospace 8', 'Font used in console panel')
prefs.add_option('MIMIC_PANEL_COLORS_TO_EDITOR_THEME', True,
                 'Try to apply editor color theme to various panels')
prefs.add_option('WINDOW_BORDER_WIDTH', 0, 'Adjust window border width if you have bad wm')
prefs.add_option('SHOW_TABS', None,
                 'State of tabs visibility. Set it to None to use window specific settings')
prefs.add_option('TAB_BAR_PLACEMENT', None,
                 '''Tab bar placement position. One of "top", "bottom", "left", "right"
                    Set it to None to use window specific settings''')

prefs.add_internal_option('WINDOWS', list)
prefs.add_internal_option('MODIFIED_FILES', dict)

map_generic('root-menu', 'F1')
map_generic('activate-search-entry', '<ctrl>s')
map_generic('escape', 'Escape')
map_generic('delete', 'Delete')

map_generic('prev', '<ctrl>Up', 1)
map_generic('next', '<ctrl>Down', 1)

map_generic('goto-definition', 'F3')
map_generic('show-outline', '<ctrl>o')
map_generic('show-calltip', '<ctrl>Return', 1)


class EditorManager(object):
    def __init__(self, session):
        self.buffers = []
        self.windows = []

        self.session = session
        self.style_manager = gtksourceview2.style_scheme_manager_get_default()
        self.lang_manager = gtksourceview2.language_manager_get_default()
        self.modify_lang_search_path(self.lang_manager)

        self.activator = Activator()
        self.activator.add_context('manager', (), lambda: self)
        self.activator.bind_accel('manager', 'quit', '_File/$_Quit', '<ctrl>q', EditorManager.quit)

        self.plugin_manager = PluginManager(self.activator)

        self.init_conf()
{'fraction_non_alphanumeric': 0.11170321787251486, 'fraction_numerical': 0.0038942406230784996, 'mean_word_length': 4.635103926096997, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '200325', 'n_tokens_mistral': 1563, 'n_tokens_neox': 1520, 'n_words': 371}