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

fix(statuscol-nvim): flickring when statuscol width is not default #615

Closed
wants to merge 1 commit into from

Conversation

meijieru
Copy link
Contributor

📑 Description

When the status column has a non-default width, alpha-nvim may shift, leading to flickering.
This pull request addresses the issue and enhances performance.

An example configuration is provided.

{
    "statuscol.nvim",
    opts = function(_, _)
      local builtin = require "statuscol.builtin"
      local opts = {
        setopt = true,
        -- https://github.com/luukvbaal/statuscol.nvim/issues/72#issuecomment-1593828496
        ft_ignore = { "Overseer*" },
        bt_ignore = { "nofile", "prompt" },
        segments = {
          {
            sign = { name = { "GitSigns" }, maxwidth = 1, colwidth = 1, auto = false },
            click = "v:lua.ScSa",
          },
          {
            text = { builtin.lnumfunc, " " },
            condition = { true, builtin.not_empty },
            click = "v:lua.ScLa",
          },
          {
            sign = { name = { ".*" }, maxwidth = 1, colwidth = 1, auto = false },
            click = "v:lua.ScSa",
          },
          { text = { builtin.foldfunc, " " }, click = "v:lua.ScFa" },
        },
      }
      return opts
    end,
  }

ℹ Additional Information

@github-actions
Copy link

Review Checklist

Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:

Proper conventional commit scoping:

  • If you are adding a new plugin, the scope would be the name of the category it is being added into. ex. feat(utility): added noice.nvim plugin

  • If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex. fix(noice-nvim): fix LSP handler error

  • Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above

  • README is properly formatted and uses fenced in links with <url> unless they are inside a [title](url)

  • Proper usage of opts table rather than setting things up with the config function.

@Uzaaft
Copy link
Member

Uzaaft commented Oct 19, 2023

How does this enhance performance?

@meijieru
Copy link
Contributor Author

By delaying the loading into User AstroFile event

{
"luukvbaal/statuscol.nvim",
event = "User AstroFile",
lazy = vim.fn.argv()[1] == nil,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why this is here. You're checking of neovim was opened with a file, but User AstroFile does that itself.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to load the plugin if the filename is empty, I'd just swap the event out instead of having this lazy = vim.fn.... thing

@Uzaaft
Copy link
Member

Uzaaft commented Oct 31, 2023

Closing this

@Uzaaft Uzaaft closed this Oct 31, 2023
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