Skip to content

Fix backlink handling and improve item selection#852

Closed
dingbat-rascal wants to merge 6 commits into
obsidian-nvim:mainfrom
dingbat-rascal:main
Closed

Fix backlink handling and improve item selection#852
dingbat-rascal wants to merge 6 commits into
obsidian-nvim:mainfrom
dingbat-rascal:main

Conversation

@dingbat-rascal
Copy link
Copy Markdown

@dingbat-rascal dingbat-rascal commented May 24, 2026

Backlinks command quickfix widows resolved.
Now, on use of the command, you are not stuck with the native nvim quickfix ui also displaying along with the users set picker. Also replaced empty ui, with notification of "No backlink" instead.

Before when using snacks.picker, the native horizontal quickfix select menu would display along with whatever picker you decide to use. This means after you make a selection the native window would also have to be exited. The pickers also would display if no backlinks were present. I've been nesting snack.picker logic nested in my keybinds however, im not sure if this is the intended use? example vim.keymap.set("n", "<leader>ob" function() Snacks.picker.<whateverpicker>opts = {}

@neo451
Copy link
Copy Markdown
Member

neo451 commented May 24, 2026

stuck with the native nvim quickfix ui also displaying along with the users set picker
empty ui

these are vague description, maybe open a issue describing what is fixed and how to reproduce

@dingbat-rascal
Copy link
Copy Markdown
Author

stuck with the native nvim quickfix ui also displaying along with the users set picker
empty ui

these are vague description, maybe open a issue describing what is fixed and how to reproduce

pr description edited

@neo451
Copy link
Copy Markdown
Member

neo451 commented May 25, 2026

  1. added format_item is already set in picker/util with the default make_display which is a generalized version that handles file icons and others, if you want cleaner output, we can think how to customize it
  2. added callback is already the default in picker implementations
  3. the no backlinks on 0 items is also confusing, I fail to reproduce "an empty ui", pickers will tell you there are zero items, I think that is good enough, but it is ok to merge since that is

so the issue is you should show me your config and :checkhealth obsidian, so that we can work out why the defaults are not working for you, especially that doubling of picker and quickfix ui, I really can not think of why that is

@dingbat-rascal
Copy link
Copy Markdown
Author

dingbat-rascal commented May 25, 2026

The only warning form checkhealth was -
warning from check health - [Sync] ~

  • ⚠️ WARNING It is recommended to install at least one of { "ob" }

here was the 2 qf menus i was referring to before fix
obsidian-nvim example

      vim.keymap.set("n", "ob", function()
        Snacks.picker.qflist {
        cwd = vim.cmd "Obsidian backlinks"
      }
      end, { desc = "Snacks: Backlinks" })

how i configured backlink keybind

@neo451
Copy link
Copy Markdown
Member

neo451 commented May 25, 2026

ok, the right way to find backlinks is just 1. run in cmdline :Obsidian backlinks 2. or type grr on notes or links

first approach automatically finds the picker you are using and open the results in picker

so just do

      vim.keymap.set("n", "ob", function()
        vim.cmd "Obsidian backlinks"
      end, { desc = "Backlinks" })

or more simple

vim.keymap.set("n", "ob", "<cmd>Obsidian backlinks<cr>", { desc = "Backlinks", expr = true })

your example call vim.cmd resulting in the right snacks interface to show up, and then the qflist call knowing no real info on what items to show just give you an empty one.

@neo451 neo451 closed this May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants