nvim-telekasten / telekasten.nvim

A Neovim (lua) plugin for working with a markdown zettelkasten / wiki and mixing it with a journal, based on telescope.nvim
MIT License
1.3k stars 85 forks source link

[BUG] Weird behaviour while using backlinks #95

Open reisnobre opened 2 years ago

reisnobre commented 2 years ago

Please confirm

Describe the bug Fresh installion of the plugin, nothing customized at all. Running on macOs, but besides that everthing is as recommended.

To Reproduce Steps to reproduce the behavior:

  1. Start nvim
  2. Go to a note that has backlinks
  3. Call the backlink function
  4. A weird path appears on the telescope searchbox instead of the filename correctly.

Expected behavior The list of files that links to the current file should appear

Screenshots

Screen Shot 2022-02-21 at 23 11 13

Operating system (please complete the following information):

bergtholdt commented 2 years ago

Looks like the the full path of the file is included in the grep string. Maybe you telekasten home is not set properly in your initialization.

I just had a problem where backlinks did not work and the reason was that I used obsidian to when creating the files and it does not use subdirectories for the links. In my telekasten config, however, I had subdirs_in_links = true, which caused the the backlinks search to include the subfolder and no files were shown. Once I fixed the config, chaning subdirs_in_links = false, I properly get backlinks.

wakatara commented 2 years ago

Setting subdirs_in_links = false also corrected this problem for me when I was playing around with (even though there was a subdir in the link, so not sure if that's the right behaviour or not.

But thanks @bergtholdt for the pointer!

lambtho12 commented 2 years ago

@reisnobre Considering the inputs of @bergtholdt and @wakatara , should we still keep this open?

alexander-gabriel commented 2 years ago

this fails for me due to the regexp formatting and escaping of brackets. I can't find information in the telescope git on whether or not it supports regexp search patterns or how to enable/disable regexp parsing of search terms.

may be relevant: I'm using the telescope-fzf-native extension

lambtho12 commented 1 year ago

@alexander-gabriel any new information on that? Does the issue still persist? Did you find a solution?

fingolfin19 commented 7 months ago

I have the same issue on Windows. When subdir_in_links is true, the entire path of the current file is included in the backlink regex. Setting subdir_in_links to false results in the correct pattern, but backlinks should add subdirs starting from the home directory.

Home for me should be set correctly:

{
    "renerocksai/telekasten.nvim",
    cmd = "Telekasten",
    opts = {
        home = vim.fn.expand("C:/Users/me/Documents/Notes"), -- Put the name of your notes directory here
    },
},

Find notes and find daily notes commands start at the correct directory.