mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-23 02:23:07 +02:00
main: Support unicode tag selection
This commit is contained in:
parent
6c70cdcecc
commit
5e601bcf97
1 changed files with 5 additions and 3 deletions
|
@ -560,18 +560,20 @@ class ChooseSplitTags(CallbackSplitMixin, SplitTags):
|
|||
split_cursorline = True
|
||||
|
||||
def _get_selected_tag(self):
|
||||
tag_re = re.compile(r'^(?P<name>[^\s]+)\s+[0-9]+$')
|
||||
tag_re = re.compile(r'^(?P<name>[^\s]+)\s+[0-9]+$', re.UNICODE)
|
||||
match = tag_re.match(vim.current.line)
|
||||
|
||||
if match:
|
||||
return match.group('name')
|
||||
tag = match.group('name')
|
||||
tag = tag.decode('utf-8') if six.PY2 else tag
|
||||
return tag
|
||||
else:
|
||||
raise errors.TaskWikiException("No tag selected.")
|
||||
|
||||
@errors.pretty_exception_handler
|
||||
def callback(self):
|
||||
tag = self._get_selected_tag()
|
||||
self.selected.modify("+{0}".format(tag))
|
||||
self.selected.modify(u"+{0}".format(tag))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue