def add_error(self, view, error_dict):
"""Put new compile error in the dictionary of errors.
Args:
view (sublime.View): current view
error_dict (dict): current error dict {row, col, file, region}
"""
logging.debug(" adding error %s", error_dict)
error_source_file = path.basename(error_dict['file'])
if error_source_file == path.basename(view.file_name()):
row = int(error_dict['row'])
col = int(error_dict['col'])
point = view.text_point(row - 1, col - 1)
error_dict['region'] = view.word(point)
if row in self.err_regions[view.buffer_id()]:
self.err_regions[view.buffer_id()][row] += [error_dict]
else:
self.err_regions[view.buffer_id()][row] = [error_dict]
评论列表
文章目录