generated from itdominator/Python-With-Gtk-Template
Re-added events; adeed get_text method
This commit is contained in:
parent
c5f0d8e597
commit
9836285f86
@ -146,7 +146,7 @@ class FileEventsMixin:
|
||||
buffer.uri = uri
|
||||
buffer.language_id = self._current_filetype
|
||||
|
||||
event_system.emit("textDocument/didOpen", (self._current_filetype, uri,))
|
||||
event_system.emit("textDocument/didOpen", (self._current_filetype, uri, self.get_text()))
|
||||
|
||||
word_completion = GtkSource.CompletionWords.new("word_completion")
|
||||
word_completion.register(buffer)
|
||||
|
@ -13,6 +13,11 @@ from .source_view_events import SourceViewEvents
|
||||
|
||||
|
||||
class SourceViewControllerMixin(KeyInputController, SourceViewEvents):
|
||||
def get_text(self):
|
||||
buffer = self.get_buffer()
|
||||
start_itr, end_itr = buffer.get_bounds()
|
||||
return buffer.get_text(start_itr, end_itr, True)
|
||||
|
||||
def get_current_file(self):
|
||||
return self._current_file
|
||||
|
||||
|
@ -26,8 +26,8 @@ class SourceViewEvents(SourceViewDnDMixin, MarkEventsMixin, FileEventsMixin):
|
||||
|
||||
if not self._loading_file:
|
||||
event_system.emit("buffer_changed", (buffer, ))
|
||||
# event_system.emit("textDocument/didChange", (file_type, buffer, ))
|
||||
# event_system.emit("textDocument/completion", (self, ))
|
||||
event_system.emit("textDocument/didChange", (file_type, buffer, ))
|
||||
event_system.emit("textDocument/completion", (self, ))
|
||||
|
||||
self.update_cursor_position(buffer)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user