Giter Site home page Giter Site logo

astronvim / astroui Goto Github PK

View Code? Open in Web Editor NEW
17.0 1.0 9.0 252 KB

UI Configuration Engine built for AstroNvim

Home Page: https://AstroNvim.com

License: GNU General Public License v3.0

Lua 100.00%
lua neovim astrovim astronvim neovim-lua-plugin neovim-plugin neovim-ui

astroui's People

Contributors

astronvimbot avatar chaozwn avatar github-actions[bot] avatar loichyan avatar mehalter avatar subjective avatar whoop-t avatar wroyca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

astroui's Issues

AstroUI config doesn't include the user config when extending heirline

Checklist

  • I have searched through the AstroNvim docs
  • I have searched through the existing issues of AstroNvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.9.5

Operating system/version

macOS 14.4.1

Terminal/GUI

iTerm

Describe the bug

❗ I need to do some more investigation and narrow down a reproduction, so this issue is preliminary for now.

The issue I'm facing is related to porting my custom tab pages heirline config to V4. I get the following error:

Screenshot 2024-04-09 at 15 29 56

If I print the contents of config from file_icon in astroui/status/hl on line 68, like this:

function M.file_icon(name)
  print(vim.inspect(config))
  local hl_enabled = config.icon_highlights.file_icon[name]
  return function(self)
    if hl_enabled == true or (type(hl_enabled) == "function" and hl_enabled(self)) then
      return M.filetype_color(self)
    end
  end
end

I see that the config is empty:
Screenshot 2024-04-10 at 17 18 29.

This is wrong, since I have the following config for astroui:

return {
  "AstroNvim/astroui",
  ---@type AstroUIOpts
  opts = {
    -- change colorscheme
    colorscheme = "dracula",
    -- AstroUI allows you to easily modify highlight groups easily for any and all colorschemes
    highlights = {
      init = { -- this table overrides highlights in all themes
        -- Normal = { bg = "#000000" },
      },
      astrotheme = { -- a table of overrides/changes when applying the astrotheme theme
        -- Normal = { bg = "#000000" },
      },
    },
    status = {
      -- Configure attributes of components defined in the `status` API. Check the AstroNvim documentation for a complete list of color names, this applies to colors that have `_fg` and/or `_bg` names with the suffix removed (ex. `git_branch_fg` as attributes from `git_branch`).
      attributes = {
        git_branch = { bold = true },
      },
      -- Configure colors of components defined in the `status` API. Check the AstroNvim documentation for a complete list of color names.
      colors = {
        git_branch_fg = "#ABCDEF",
      },
      -- Configure which icons that are highlighted based on context
      icon_highlights = {
        -- enable or disable breadcrumb icon highlighting
        breadcrumbs = false,
        -- Enable or disable the highlighting of filetype icons both in the statusline and tabline
        file_icon = {
          tabline = function(self) return self.is_active or self.is_visible end,
          statusline = true,
        },
      },
      -- Configure characters used as separators for various elements
      separators = {
        none = { "", "" },
        left = { "", "  " },
        right = { "  ", "" },
        center = { "  ", "  " },
        tab = { "", "" },
        breadcrumbs = "",
        path = "",
      },
    },
    -- Icons can be configured throughout the interface
    icons = {
      -- configure the loading of the lsp in the status line
      LSPLoading1 = "",
      LSPLoading2 = "",
      LSPLoading3 = "",
      LSPLoading4 = "",
      LSPLoading5 = "",
      LSPLoading6 = "",
      LSPLoading7 = "",
      LSPLoading8 = "",
      LSPLoading9 = "",
      LSPLoading10 = "",
    },
  },
}

If I modify hl.lua on line 12, so that the definition of config becomes an inline function - resulting in the config is always re-evaluated, I see that the expected value, like this:

local config = function() return assert(require("astroui").config.status) end

and update uses of config to config(), I see the expected values when I print config from file_icon:
Screenshot 2024-04-10 at 17 25 33

Converting to a function also fixes the error shown at the start of this issue, since config().icon_hightlights.file_icon[name] in hl.lua now has a valid value.

This feels like a timing issue, but I see that astroui has a priority of 1000 and is lazy = false, so I'd expect it to be already setup and ready to go by the time that I use it via my heirline config.

I'll try to debug some more later and narrow this down to a repro and update this issue - I just needed to get this out whilst I had the motivation to write it up!

Steps to Reproduce

todo

Expected behavior

n/a

Screenshots

No response

Additional Context

No response

Repro

No response

Heirline.nvim doesn't play with QuickList and LocList

Checklist

  • I have searched through the AstroNvim docs
  • I have searched through the existing issues of AstroNvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.10.0-dev+2507-g3df1211eb

Operating system/version

Linux fedora 6.7.7-200.fc39.x86_64

Terminal/GUI

kitty 0.31.0

Describe the bug

We're faced with some issues when we start using Quickfix and Loclist; these issues mostly include the ones I've found so far, and chance are that it's not inclusive so it's probably make sense to consider it as meta.

    1. Heirline draw it statuscol in Quickfix and LocList
    1. Heirline will draw over the command line

Here's how it should look in practice:

Screenshot from 2024-03-07 08-07-05

Here's how it currently look:

image

One thing is that it almost looks as intended on the dashboard (minus the status column):

image

Steps to Reproduce

  1. Use astrocommunity Coc
  2. CocList ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.