Hello,
I try to create a plugin for detect Vietnamese in html file. I have a problem: The highlight just fill 1 letter each words
Like this: https://gyazo.com/6916576a15412f950c9418bed68a6378
I want to show like this: https://gyazo.com/fc13fe7f40888d421b78d9ff9447bc4d
Please help me fix it.
Here is my code: (Sorry my english is not good)
import sublime
import sublime_plugin
class HighlightChars(sublime_plugin.EventListener):
def on_activated(self, view):
self.view = view
self.runPlugin()
def on_modified_async(self, view):
self.runPlugin()
def runPlugin(self):
if ( (self.view.file_name() is not None) and (self.view.file_name().find('.html') != -1 or self.view.file_name().find('.css') != -1 or self.view.file_name().find('.scss') != -1 or self.view.file_name().find('.js') != -1 or self.view.file_name().find('.pug') != -1)):
self.highlight()
def highlight(self):
needle = '[àáãạảăắằẳẵặâấầẩẫậèéẹẻẽêềếểễệđìíĩỉịòóõọỏôốồổỗộơớờởỡợùúũụủưứừửữựỳỵỷỹýÀÁÃẠẢĂẮẰẲẴẶÂẤẦẨẪẬÈÉẸẺẼÊỀẾỂỄỆĐÌÍĨỈỊÒÓÕỌỎÔỐỒỔỖỘƠỚỜỞỠỢÙÚŨỤỦƯỨỪỬỮỰỲỴỶỸÝ]'
self.view.add_regions('foo_string', self.view.find_all(needle), 'string2', 'circle')