weirongxu / coc-markdown-preview-enhanced

Markdown Preview Enhanced for coc.nvim
Other
90 stars 1 forks source link

[BUG] "Create ToC" not working #10

Closed DehanLUO closed 2 years ago

DehanLUO commented 2 years ago

Describe the bug

Hi. Using this package in MacOS12.3. When I use the command Create ToC in the command pallette, only the below line is appended.

<!-- @import "[TOC]" {cmd:"toc", depthFrom:1, depthTo:6, orderedList:false} -->

Headings are not generated below the above insertion. Let me know if you need more details. Thanks.

Result from CocInfo

## versions

vim version: VIM - Vi IMproved 8.2 8023455
node version: v17.5.0
coc.nvim version: 0.0.80-ccd0b050e0
coc.nvim directory: /Users/dehan/.vim/plugged/coc.nvim
term: Apple_Terminal
platform: darwin

## Log of coc.nvim

2022-03-10T02:42:22.954 INFO (pid:14454) [plugin] - coc.nvim initialized with node: v17.5.0 after 831ms
2022-03-10T02:43:12.246 INFO (pid:14454) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.openPreview' ]
2022-03-10T02:43:28.014 INFO (pid:14454) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.runAllCodeChunks' ]
2022-03-10T02:48:53.001 INFO (pid:14454) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.createTOC' ]
2022-03-10T02:49:46.625 INFO (pid:14454) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.runAllCodeChunks' ]
2022-03-10T02:50:06.100 INFO (pid:14454) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.openPreview' ]
2022-03-10T02:52:28.313 INFO (pid:14454) [attach] - receive notification: showInfo []
2022-03-10T02:52:45.318 INFO (pid:14454) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.createTOC' ]
2022-03-10T02:53:07.711 INFO (pid:14454) [attach] - receive notification: showInfo []

Steps to reproduce Steps to reproduce the behavior:

  1. execute vim
  2. :CocCommand markdown-preview-enhanced.openPreview
  3. clicked on the first symbol and this opened the side bar having the TOC
  4. :CocCommand markdown-preview-enhanced.createTOC
  5. :w Save my markdown file.
  6. Nothing else happens on save. Toc is not embedded.

Expected behavior

Toc is embedded correctly.

Thanks.

DehanLUO commented 2 years ago

Thanks. It works. Have a good day