Exemplo n.º 1
0
def _on_unoad():
    global _input_tracker
    assert(_input_tracker is not None)
    _input_tracker = None

    global _expands_completion_model
    assert(_expands_completion_model is not None)
    for doc in kate.documentManager.documents():
        for view in doc.views():
            cci = view.codeCompletionInterface()
            cci.unregisterCompletionModel(_expands_completion_model)
    _expands_completion_model = None
Exemplo n.º 2
0
def _on_load():
    global _input_tracker
    assert(_input_tracker is None)
    _input_tracker = _KeySequenceTracker()

    global _expands_completion_model
    assert(_expands_completion_model is None)
    _expands_completion_model = _ExpandsCompletionModel(kate.application)
    _expands_completion_model.modelReset.connect(_reset)
    # Set completion model for all already existed views
    # (cuz the plugin can be loaded in the middle of editing session)
    for doc in kate.documentManager.documents():
        for view in doc.views():
            cci = view.codeCompletionInterface()
            cci.registerCompletionModel(_expands_completion_model)
Exemplo n.º 3
0
def _createSignalAutocompleteExpands(view):
    global _expands_completion_model
    if view:
        cci = view.codeCompletionInterface()
        cci.registerCompletionModel(_expands_completion_model)