Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slowdown when closing a window #768

Open
vitvly opened this issue Nov 8, 2024 · 0 comments
Open

Slowdown when closing a window #768

vitvly opened this issue Nov 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@vitvly
Copy link

vitvly commented Nov 8, 2024

🐛 Describe the bug

Hi, and thanks for the wonderful plugin!

I've noticed that closing a window with .md document in it exhibits some slowdown. It takes approximately a second between the keypress and the window actually closing. I'm not sure what is this related to.

I tried disabling nvim-treesitter for a start, but it didn't help. However, disabling obsidian.nvim plugin helps.

Can you please advise on what could the possible culprits be, or how to debug this?

Config

require("obsidian").setup({
      workspaces = {
        {
          name = "default",
          path = "$NOTES",
        },
      },
      picker = {
        -- Set your preferred picker. Can be one of 'telescope.nvim', 'fzf-lua', or 'mini.pick'.
        name = "fzf-lua", --"mini.pick",
            -- Optional, configure key mappings for the picker. These are the defaults.
        -- Not all pickers support all mappings.
        note_mappings = {
          -- Create a new note from your query.
          new = "<C-x>",
          -- Insert a link to the selected note.
          insert_link = "<C-l>",
        },
        tag_mappings = {
          -- Add tag(s) to current note.
          tag_note = "<C-x>",
          -- Insert a tag at the current location.
          insert_tag = "<C-l>",
        },
      },
      -- Optional, customize how note IDs are generated given an optional title.
      ---@param title string|?
      ---@return string
      note_id_func = function(title)
        -- Create note IDs in a Zettelkasten format with a timestamp and a suffix.
        -- In this case a note with the title 'My new note' will be given an ID that looks
        -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md'
        local suffix = ""
        if title ~= nil then
          -- If title is given, transform it into valid file name.
          suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
        else
          -- If title is nil, just add 4 random uppercase letters to the suffix.
          for _ = 1, 4 do
            suffix = suffix .. string.char(math.random(65, 90))
          end
        end
        return os.date('%y%m%d%H%M') .. "-" .. suffix
      end,
      preferred_link_style = "markdown"
    })

Environment

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1727870382
Run "nvim -V1 -v" for more info

Obsidian.nvim v3.9.0 (14e0427bef6c55da0d63f9a313fd9941be3a2479)
Status:
  • buffer directory: nil
  • working directory: /Users/vitvly/notes
Workspaces:
  ✓ active workspace: Workspace(name='default', path='/Users/vitvly/notes', root='/Users/vitvly/notes')
Dependencies:
  ✓ plenary.nvim: 2d9b06177a975543726ce5c73fca176cedbffe9d
  ✓ nvim-cmp: f17d9b4394027ff4442b298398dfcaab97e40c4f
  ✓ fzf-lua: ce1e24f2a48089b65deefcb0a71a9856839002b5
Integrations:
  ✓ picker: FzfPicker()
  ✓ completion: enabled (nvim-cmp) ✗ refs, ✗ tags, ✗ new
    all sources:
Tools:
  ✓ rg: ripgrep 14.1.1
Environment:
  • operating system: Darwin
Config:
  • notes_subdir: nil%

@vitvly vitvly added the bug Something isn't working label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant