def run(self, edit):
self.label_ids = []
self.labels = []
region = self.view.sel()[0]
if region.begin() == region.end():
logging.critical("Please select the complete label")
return False
word = self.view.substr(region)
for po_file in INFOS.get_po_files():
for entry in po_file:
if entry.msgid.lower() == word.lower() and entry.msgctxt not in self.label_ids:
self.label_ids.append(entry.msgctxt)
self.labels.append(["%s (%s)" % (entry.msgid, entry.msgctxt), entry.comment])
self.labels.append("Create new label")
sublime.active_window().show_quick_panel(items=self.labels,
on_select=lambda s: self.on_done(s, region),
selected_index=0)
评论列表
文章目录