def run(self, edit):
"""Sublime Text plugin run method."""
# Note, if one changes the header, this might need to change too.
pattern = util.get_vhdl_setting(self, 'vhdl-modified-time-string')
region = self.view.find(pattern, 0)
#print('Region Diagnostics')
#print('------------------')
#print('Begin: {}'.format(region.begin()))
#print('End: {}'.format(region.end()))
#print('Empty? {}'.format(region.empty()))
if not region.empty():
region = self.view.line(region)
date = time.ctime(time.time())
new_mtime = pattern + '{}'.format(date)
self.view.replace(edit, region, new_mtime)
print('vhdl-mode: Updated last modified time.')
else:
print('vhdl-mode: No last modified time field found.')
#----------------------------------------------------------------
评论列表
文章目录