def on_change(self, s):
flags = self.calculate_flags()
self.view.erase_regions('vi_inc_search')
state = self.state
occurrence = reverse_find_wrapping(self.view,
term=s,
start=0,
end=self.view.sel()[0].b,
flags=flags,
times=state.count)
if occurrence:
if state.mode == modes.VISUAL:
occurrence = Region(self.view.sel()[0].a, occurrence.a)
self.view.add_regions('vi_inc_search', [occurrence], 'string.search', '', DRAW_NO_OUTLINE)
if not self.view.visible_region().contains(occurrence):
self.view.show(occurrence)
评论列表
文章目录