Skip to content

Commit

Permalink
main.py: fix inside_vimwiki_link for markdown syntax
Browse files Browse the repository at this point in the history
Vimwiki using markdown syntax are not detecting the link syntax, therefor
instead of VimwikiFollowLink command call it will TaskwikiInfo
  • Loading branch information
plateena committed Aug 12, 2022
1 parent 22557e7 commit 553f10c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion taskwiki/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,18 @@ def task_info_or_vimwiki_follow_link():
column <= line.find(']]') + 1
])

if inside_vimwiki_link:
# Detect if the cursor stands on a vimwiki markdown syntax link,
# if so, trigger it
inside_vimwiki_md_link = all([
'[' in line,
']' in line,
'(' in line,
')' in line,
column >= line.find('['),
column <= line.find(']') + 1
])

if inside_vimwiki_link or inside_vimwiki_md_link:
vim.command('VimwikiFollowLink')
return

Expand Down

0 comments on commit 553f10c

Please sign in to comment.