mzlogin/vim-markdown-toc

Removing existed insert fence, then UpdateToc manually raises error.

liuchengxu opened this issue · 3 comments

Error detected while processing function <SNR>120_UpdateToc[5]..<SNR>120_DeleteExistingToc:
line   29:
Cannot find toc begin fence
Error detected while processing function <SNR>120_UpdateToc:
line    8:
Cannot find existing toc

It's noted that insert fence followed is neccessay for auto save, but I don't need it and like running :UpdateToc manually, in which situation the error above occurs. I think it should be coverd.

<!-- vim-markdown-toc GFM -->
toc
<!-- vim-markdown-toc -->

Sorry about that, it's my fault there is no clear description in the doc.

As of now, :UpdateToc command is only useful when g:vmt_auto_update_on_save is turn off and keep insert fence on.

The fence have two functions, the most important it can mark which Markdown parser link style the toc is, like GFM or Redcarpet, and it also mark start and end of the toc.

Unless one day I find and implement a better idea to replace this strategy, the fence is needed when update toc, whether auto update on save or use :UpdateToc command.

If you want to update toc without fence existing, now you can only delete existing toc manually and rerun :GenTocXXX command.

Hope you find a better solution!

Thanks. I'll keep thinking about it.

Because it is not a bug on the basis of current strategy, so I'll close this issue first. If I find a better solution, I will @ you here. And if you have some idea, please let me know.

I will update instructions of :UpdateToc command in the doc, and change the error output to normal message level later.

Thanks for reporting, more feedbacks are welcome.