I am using this plugin here to mark the changes lines, it adds a dot, but I was hoping to highlight the line in the editor and the minimap. Is this possible? Can you please point me in right direction. First time plugin writer here (no to python as well).
import sublime, sublime_plugin
import types
class ClearChangesCommand(sublime_plugin.EventListener):
def on_post_save(self, view):
view.erase_regions('unsaved')
class HighlightUnsavedCommand(sublime_plugin.EventListener):
def on_modified(self, view):
unsaved = view.get_regions('unsaved') + [view.line(s) for s in view.sel()]
if not isinstance(view.file_name(), types.NoneType):
with open(view.file_name(), 'r') as f:
read_data = unicode(f.read())
for sel in view.sel():
if read_data[view.line(sel).begin():view.line(sel).end()] == view.substr(view.line(sel)):
unsaved:] = [x for x in unsaved if x != view.line(sel)]
view.add_regions("unsaved", unsaved, "mark", "dot", sublime.HIDDEN | sublime.PERSISTENT)
I got this code from this topic here: Hightlight changed row