You can make use of the on_reload
or on_reload_async
API’s provided by ST in a small plugin. You can save this plugin in a python (.py
) file (The name of the file is upto you) in the User
directory. Since this is a ViewEventListener
, you don’t need to do anything extra.
import sublime
import sublime_plugin
class GotoLastLineReloadListener(sublime_plugin.ViewEventListener):
@classmethod
def is_applicable(cls, settings):
syntax = settings.get("syntax")
return syntax == "Packages/Text/Plain text.tmLanguage"
def on_reload_async(self):
self.view.run_command("goto_line", { "line": -1 })
This assumes of course that those log files of yours are simple plain text files. When the log files reload, this plugin will ensure any applicable files will show the cursor on the last line of the file.