From 0eedf6f3ef14f25a697af32559992dcc0b6f13b9 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Fri, 27 Jan 2017 14:24:59 +0100 Subject: [PATCH] Revert "Mappings: Delegate to VimwikiFollowLink for link creation" This reverts commit 0ac7da0fde54e5de1be07aabee5aa2588f34df73. The commit contained code that was included by mistake. --- taskwiki/main.py | 7 +------ taskwiki/regexp.py | 4 ++-- tests/test_viewport.py | 25 ------------------------- 3 files changed, 3 insertions(+), 33 deletions(-) diff --git a/taskwiki/main.py b/taskwiki/main.py index bfd5609..bfc3fa5 100644 --- a/taskwiki/main.py +++ b/taskwiki/main.py @@ -266,7 +266,7 @@ class Mappings(object): vim.command('VimwikiFollowLink') return - # No link detected, check for viewport or a task + # No link detected, so it's our stuff now if cache.vwtask[row] is not None: SelectedTasks().info() else: @@ -274,11 +274,6 @@ class Mappings(object): if port is not None: Meta().inspect_viewport() - # No link detected, not a viewport or a task, so delegate to - # VimwikiFollowLink for link creation - vim.command('VimwikiFollowLink') - - class Meta(object): diff --git a/taskwiki/regexp.py b/taskwiki/regexp.py index bd5a5df..04e360a 100644 --- a/taskwiki/regexp.py +++ b/taskwiki/regexp.py @@ -19,7 +19,7 @@ TEXT = r'(?P.+?)' COMPLETION_MARK = r'(?P.)' PRIORITY = r'(?P!{1,3})' -GENERIC_TASK = re.compile(u''.join([ +GENERIC_TASK = re.compile(''.join([ '^', EMPTY_SPACE, BRACKET_OPENING, @@ -36,7 +36,7 @@ GENERIC_TASK = re.compile(u''.join([ ')?', # UUID is not there for new tasks SPACE_UNNAMED, '$' # Enforce match on the whole line -]), re.UNICODE) +])) DATETIME_FORMAT = "(%Y-%m-%d %H:%M)" DATE_FORMAT = "(%Y-%m-%d)" diff --git a/tests/test_viewport.py b/tests/test_viewport.py index 9f83f59..74bfa06 100644 --- a/tests/test_viewport.py +++ b/tests/test_viewport.py @@ -599,28 +599,3 @@ class TestViewportsPreserveHierarchyUponCompletion(IntegrationTest): sleep(0.5) self.command("w", regex="written$", lines=1) sleep(0.5) - - -class TestViewportRecurrentInstanceTaskGeneration(IntegrationTest): - - viminput = """ - === Work tasks | +TODAY === - """ - - vimoutput = """ - === Work tasks | +TODAY === - * [ ] daily task #{uuid} - """ - - tasks = [ - dict(description="daily task", recur="daily", due="today"), - ] - - def execute(self): - self.command("w", regex="written$", lines=1) - - # Assert that the task did not change after another successful - # subsequent saving. See pull request #125. - self.command("w", regex="written$", lines=1) - task = self.tw.tasks.pending()[0] - assert task['description'] == "daily task"