/usr/lib/gedit/plugins/latex/snippetmanager.py is in gedit-latex-plugin 3.20.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | # -*- coding: utf-8 -*-
# Copyright (C) 2011 - Ignacio Casal Quinteiro
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
from .singleton import Singleton
import logging
LOG = logging.getLogger(__name__)
class SnippetManager(Singleton):
def __init_once__(self):
pass
def insert(self, editor, iter, text):
view = editor.tab_decorator.tab.get_view()
window = view.get_toplevel()
bus = window.get_message_bus()
if bus.is_registered('/plugins/snippets', 'parse-and-activate'):
bus.send('/plugins/snippets', 'parse-and-activate',
snippet=text, iter=iter, view=view)
LOG.info("Inserted using snippets plugin")
else:
buf = view.get_buffer()
buf.begin_user_action()
buf.insert(iter, text)
buf.end_user_action()
LOG.info("Inserted without snippets plugin")
def insert_at_cursor(self, editor, text):
buf = editor.tab_decorator.tab.get_document()
insert = buf.get_insert()
iter = buf.get_iter_at_mark(insert)
self.insert(editor, iter, text)
# vi:ex:ts=4:et:
|