Skip to content

Commit 9542db2

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 9542db2

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

taskwiki/main.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,19 @@ 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+
line.find('[') < line.find(']('),
311+
line.find('](') < line.find(')'),
312+
column >= line.find('['),
313+
column <= line.find(')') + 1
314+
])
315+
316+
if inside_vimwiki_link or inside_vimwiki_md_link:
305317
vim.command('VimwikiFollowLink')
306318
return
307319

0 commit comments

Comments
 (0)