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

Error on closing outline when computer is running slow #65

Open
m-abubakar opened this issue Apr 23, 2024 · 0 comments · May be fixed by #66
Open

Error on closing outline when computer is running slow #65

m-abubakar opened this issue Apr 23, 2024 · 0 comments · May be fixed by #66
Labels
bug Something isn't working

Comments

@m-abubakar
Copy link

Hi,
I have been facing following issue when my PC is running bit slow and I quickly open and close outline.

Error executing lua callback: ...ite/pack/lazy/opt/outline.nvim/lua/outline/highlight.lua:12: Invalid 'buffer': Expected Lua number
stack traceback:
	[C]: in function 'nvim_buf_clear_namespace'
	...ite/pack/lazy/opt/outline.nvim/lua/outline/highlight.lua:12: in function 'clear_all_ns'
	...vim/site/pack/lazy/opt/outline.nvim/lua/outline/view.lua:96: in function 'clear_all_ns'
	.../site/pack/lazy/opt/outline.nvim/lua/outline/sidebar.lua:875: in function 'build_outline'
	.../site/pack/lazy/opt/outline.nvim/lua/outline/sidebar.lua:293: in function '_update_lines'
	.../site/pack/lazy/opt/outline.nvim/lua/outline/sidebar.lua:707: in function '_highlight_current_item'
	.../site/pack/lazy/opt/outline.nvim/lua/outline/sidebar.lua:237: in function <.../site/pack/lazy/opt/outline.nvim/lua/outline/sidebar.lua:236>

my configuration is as follows: ( I have been using it for a long time and ported it from symbols.nvim)

{
  "hedyhli/outline.nvim",
  config = function()
    require("outline").setup {
      highlight_hovered_item = true,
      show_guides = true,
      auto_preview = false,
      position = 'right',
      relative_width = true,
      width = 34,
      auto_close = false,
      show_numbers = false,
      show_relative_numbers = true,
      show_symbol_details = false,
      preview_bg_highlight = 'Pmenu',
      autofold_depth = nil,
      auto_unfold_hover = true,
      fold_markers = { '', '' },
      wrap = false,
      symbol_folding = {
        autofold_depth = 1,
        auto_unfold = {
          hovered = true,
        },
      },
      outline_window = {
        show_cursorline = true,
        hide_cursor = true,
        jump_highlight_duration = 1,
      },
      --outline_items = {
      --  show_symbol_lineno = true,
      --},
      keymaps = { -- These keymaps can be a string or a table for multiple keys
        close = { "<Esc>", "q" },
        goto_location = "<Cr>",
        focus_location = "o",
        hover_symbol = "<C-space>",
        toggle_preview = "K",
        rename_symbol = "r",
        code_actions = "a",
        fold = "h",
        unfold = "l",
        fold_all = "W",
        unfold_all = "E",
        fold_reset = "R",
      },

      lsp_blacklist = {},
      symbol_blacklist = {},
      symbols = {
        File = { icon = "", hl = "@text.uri" },
        Module = { icon = "󰕳", hl = "@namespace" },
        Namespace = { icon = "", hl = "@namespace" },
        Package = { icon = "󰏓", hl = "@namespace" },
        Class = { icon = "𝓒", hl = "@type" },
        Method = { icon = "ƒ", hl = "@method" },
        Property = { icon = "", hl = "@method" },
        Field = { icon = "󰘤", hl = "@field" },
        Constructor = { icon = "", hl = "@constructor" },
        Enum = { icon = "ℰ", hl = "@type" },
        Interface = { icon = "", hl = "@type" },
        Function = { icon = "", hl = "@function" },
        Variable = { icon = "", hl = "@constant" },
        Constant = { icon = "", hl = "@constant" },
        String = { icon = "𝓐", hl = "@string" },
        Number = { icon = "#", hl = "@number" },
        Boolean = { icon = "⊨", hl = "@boolean" },
        Array = { icon = "", hl = "@constant" },
        Object = { icon = "⦿", hl = "@type" },
        Key = { icon = "🔐", hl = "@type" },
        Null = { icon = "NULL", hl = "@type" },
        EnumMember = { icon = "", hl = "@field" },
        Struct = { icon = "𝓢", hl = "@type" },
        Event = { icon = "🗲", hl = "@type" },
        Operator = { icon = "+", hl = "@operator" },
        TypeParameter = { icon = "𝙏", hl = "@parameter" },
        Component = { icon = "󰹫", hl = "@function" },
        Fragment = { icon = "󱀤", hl = "@constant" },
      }
    }
  end,
}

I have a patch as well which apparently fixes this issue. I will create the PR along with this issue.
So:

  • If I made a mistake in config then please do let me know and thank you for taking the time to go through my lengthy config and finding the issue 😺
  • If the config seems ok, then please do review the PR and by all means do suggest if you think there is a better way to fix the issue.

Thank you.

m-abubakar pushed a commit to m-abubakar/outline.nvim that referenced this issue Apr 23, 2024
Error on closing outline when computer is running slow
@hedyhli hedyhli added the bug Something isn't working label May 19, 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

Successfully merging a pull request may close this issue.

2 participants