epwalsh / obsidian.nvim

Obsidian 🤝 Neovim
Apache License 2.0
3.3k stars 150 forks source link

Duplicated completion entries with random (?) case #579

Open anuramat opened 1 month ago

anuramat commented 1 month ago

🐛 Describe the bug

upper-case aliases get multiple entries with randomly changing case:

image

image

Config

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
    vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({
        "git",
        "clone",
        "--filter=blob:none",
        "--single-branch",
        "https://github.com/folke/lazy.nvim.git",
        lazypath,
    })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
    {
        "epwalsh/obsidian.nvim",
        version = "*", -- recommended, use latest release instead of latest commit
        lazy = false,
        dependencies = {
            "nvim-lua/plenary.nvim",
            -- optionals:
            "hrsh7th/nvim-cmp",
            "nvim-telescope/telescope.nvim",
            "nvim-treesitter/nvim-treesitter",
        },
        opts = {
            workspaces = {
                {
                    name = "vault",
                    path = "~/vault",
                },
            },
        },
    },
}
require("lazy").setup(plugins, {
    root = root .. "/plugins",
})

Environment

NVIM v0.10.0-dev-feaab21
Build type: Release
LuaJIT 2.1.1693350652
Run "nvim -V1 -v" for more info

Obsidian.nvim v3.7.12 (db41b1f20459293436fab510bec58c82a73bd1f7)
Status:
  • buffer directory: nil
  • working directory: /home/anuramat/minimal
Workspaces:
  ✓ active workspace: Workspace(name='vault', path='/home/anuramat/vault', root='/home/anuramat/vault')
Dependencies:
  ✓ plenary.nvim: 08e301982b9a057110ede7a735dd1b5285eb341f
  ✓ nvim-cmp: cd2cf0c124d3de577fb5449746568ee8e601afc8
  ✓ telescope.nvim: fac83a556e7b710dc31433dec727361ca062dbe9
Integrations:
  ✓ picker: TelescopePicker()
  ✓ completion: enabled (nvim-cmp) ✗ refs, ✗ tags, ✗ new
    all sources:
Tools:
  ✓ rg: ripgrep 13.0.0
Environment:
  • operating system: Linux
Config:
  • notes_subdir: nil
epwalsh commented 1 month ago

@anuramat, Obsidian.nvim tries to guess the case a user wants in this function. I'm happy to accept a PR to improve this.