jakewvincent / mkdnflow.nvim

Fluent navigation and management of markdown notebooks
GNU General Public License v3.0
683 stars 41 forks source link

Fix: Improve cmp autocompletion module #197

Open foozzi opened 7 months ago

foozzi commented 7 months ago

This module will not work properly.

  1. by default, require('mkdnflow').root_dir is an empty string (so the module will not work anymore) https://github.com/jakewvincent/mkdnflow.nvim/blob/1b24b8b5fe10fe09af4572c0165293e0dcd998aa/lua/mkdnflow.lua#L224
  2. it supports only .md files
  3. a problem in this string
    local explicit_link = transform_explicit and transform_explicit(item.label) .. extension or item.label .. extension

    Oh, I've already seen this https://github.com/jakewvincent/mkdnflow.nvim?tab=readme-ov-file#-completion-for-nvim-cmp

So I will fix it and make a pull request soon.

Thanks.

helins commented 6 months ago

A significant problem is that only base filenames are added as links as opposed to their actual path (ideally, according to the perspective). For instance, for a file foo/bar.md, the module will autocomplete on bar but insert bar.md which is sadly useless.

I am surprised no one opened an issue for this. Am I perhaps doing something wrong? 🤔