Skip to content

Commit 553f10c

Browse files
committed
main.py: fix inside_vimwiki_link for markdown syntax
Vimwiki using markdown syntax are not detecting the link syntax, therefor instead of VimwikiFollowLink command call it will TaskwikiInfo
1 parent 22557e7 commit 553f10c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

taskwiki/main.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,18 @@ def task_info_or_vimwiki_follow_link():
301301
column <= line.find(']]') + 1
302302
])
303303

304-
if inside_vimwiki_link:
304+
# Detect if the cursor stands on a vimwiki markdown syntax link,
305+
# if so, trigger it
306+
inside_vimwiki_md_link = all([
307+
'[' in line,
308+
']' in line,
309+
'(' in line,
310+
')' in line,
311+
column >= line.find('['),
312+
column <= line.find(']') + 1
313+
])
314+
315+
if inside_vimwiki_link or inside_vimwiki_md_link:
305316
vim.command('VimwikiFollowLink')
306317
return
307318

0 commit comments

Comments
 (0)