Git Product home page Git Product logo

Comments (13)

olimorris avatar olimorris commented on September 26, 2024 1

Oooooh. That shouldn't happen. Thanks for flagging. I will address this weekend.

from onedarkpro.nvim.

olimorris avatar olimorris commented on September 26, 2024 1

I've just pushed a fix. Let me know if that works. If not, happy to receive a pull request.

from onedarkpro.nvim.

Arjun31415 avatar Arjun31415 commented on September 26, 2024

Seems like a problem with this line

    colors.cursorline = colors.cursorline or utils.lighten(colors.bg, 0.97)

from onedarkpro.nvim.

olimorris avatar olimorris commented on September 26, 2024

If you remove the following lines it should work:

theme = function()
        if vim.o.background == "dark" then
            return config.dark_theme
        else
            return config.light_theme
        end
    end,

This is baked into the normal config by default

from onedarkpro.nvim.

Arjun31415 avatar Arjun31415 commented on September 26, 2024

Actually adding this line -

    local utils=require("onedarkpro.utils")

in the function definition -

function M.additional_colors()

in onedark.lua inside the colors folder works too

from onedarkpro.nvim.

Arjun31415 avatar Arjun31415 commented on September 26, 2024

If you remove the following lines it should work:

theme = function()
        if vim.o.background == "dark" then
            return config.dark_theme
        else
            return config.light_theme
        end
    end,

This is baked into the normal config by default

I took this from the README.md actually, Ill remove it now
Edit: This does not work for me

from onedarkpro.nvim.

Arjun31415 avatar Arjun31415 commented on September 26, 2024

If you remove the following lines it should work:

theme = function()
        if vim.o.background == "dark" then
            return config.dark_theme
        else
            return config.light_theme
        end
    end,

This is baked into the normal config by default

I got this from here

from onedarkpro.nvim.

olimorris avatar olimorris commented on September 26, 2024

I should have been explicit in the Readme. You're using a lot of config which is actually present by default.

Also, I see your colour overrides are setup for onedark and not onedark_vivid. Try:

colors = {onedark_vivid = {bg = '#27292d'}},

As you're using the onedark_vivid theme, you need to tell the config to apply overrides to that.

from onedarkpro.nvim.

Arjun31415 avatar Arjun31415 commented on September 26, 2024

I should have been explicit in the Readme. You're using a lot of config which is actually present by default.

Also, I see your colour overrides are setup for onedark and not onedark_vivid. Try:

colors = {onedark_vivid = {bg = '#27292d'}},

As you're using the onedark_vivid theme, you need to tell the config to apply overrides to that.

When i change both the fields to onedark it works -

vim.o.background = "dark" -- to load onedark
local onedarkpro = require("onedarkpro")
local config = {dark_theme = "onedark_vivid", light_theme = "onelight"}

onedarkpro.setup({
    dark_theme = "onedark", -- The default dark theme
    light_theme = "onelight", -- The default light theme
    -- Theme can be overwritten with 'onedark' or 'onelight' as a string
    --    theme = function()
    --      if vim.o.background == "dark" then
    --        return config.dark_theme
    --  else
    --    return config.light_theme
    --      end
    --  end,
    colors = {onedark = {bg = '#27292d'}}, -- Override default colors by specifying colors for 'onelight' or 'onedark' themes
    -- hlgroups = {}, -- Override default highlight groups
    -- filetype_hlgroups = {}, -- Override default highlight groups for specific filetypes
    -- styles = {
    --     strings = "NONE", -- Style that is applied to strings
    --     comments = "NONE", -- Style that is applied to comments
    --     keywords = "NONE", -- Style that is applied to keywords
    --     functions = "NONE", -- Style that is applied to functions
    --     variables = "NONE", -- Style that is applied to variables
    --     virtual_text = "NONE" -- Style that is applied to virtual text
    -- },
    options = {
        bold = false, -- Use the themes opinionated bold styles?
        italic = true, -- Use the themes opinionated italic styles?
        underline = false, -- Use the themes opinionated underline styles?
        undercurl = false, -- Use the themes opinionated undercurl styles?
        cursorline = true, -- Use cursorline highlighting?
        transparency = true, -- Use a transparent background?
        terminal_colors = true, -- Use the theme's colors for Neovim's :terminal?
        window_unfocussed_color = false -- When the window is out of focus, change the normal background?
    }
})
require('onedarkpro').load()

But when both are onedark_vivid it fails-

vim.o.background = "dark" -- to load onedark
local onedarkpro = require("onedarkpro")
local config = {dark_theme = "onedark_vivid", light_theme = "onelight"}

onedarkpro.setup({
    dark_theme = "onedark_vivid", -- The default dark theme
    light_theme = "onelight", -- The default light theme
    -- Theme can be overwritten with 'onedark' or 'onelight' as a string
    --    theme = function()
    --      if vim.o.background == "dark" then
    --        return config.dark_theme
    --  else
    --    return config.light_theme
    --      end
    --  end,
    colors = {onedark_vivid = {bg = '#27292d'}}, -- Override default colors by specifying colors for 'onelight' or 'onedark' themes
    -- hlgroups = {}, -- Override default highlight groups
    -- filetype_hlgroups = {}, -- Override default highlight groups for specific filetypes
    -- styles = {
    --     strings = "NONE", -- Style that is applied to strings
    --     comments = "NONE", -- Style that is applied to comments
    --     keywords = "NONE", -- Style that is applied to keywords
    --     functions = "NONE", -- Style that is applied to functions
    --     variables = "NONE", -- Style that is applied to variables
    --     virtual_text = "NONE" -- Style that is applied to virtual text
    -- },
    options = {
        bold = false, -- Use the themes opinionated bold styles?
        italic = true, -- Use the themes opinionated italic styles?
        underline = false, -- Use the themes opinionated underline styles?
        undercurl = false, -- Use the themes opinionated undercurl styles?
        cursorline = true, -- Use cursorline highlighting?
        transparency = true, -- Use a transparent background?
        terminal_colors = true, -- Use the theme's colors for Neovim's :terminal?
        window_unfocussed_color = false -- When the window is out of focus, change the normal background?
    }
})
require('onedarkpro').load()
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Error in packer_compiled: .../start/onedarkpro.nvim/lua/onedarkpro/colors/onedark.lua:38: att
empt to call field 'lighten' (a nil value)
Please check your config for correctness

from onedarkpro.nvim.

Arjun31415 avatar Arjun31415 commented on September 26, 2024

Actually adding this line -

    local utils=require("onedarkpro.utils")

in the function definition -

function M.additional_colors()

in onedark.lua inside the colors folder works too

This seems to work. But I think passing in config as a parameter to the function would be better. If you want I could raise a PR for the same

from onedarkpro.nvim.

Arjun31415 avatar Arjun31415 commented on September 26, 2024

This works. No errors now

from onedarkpro.nvim.

olimorris avatar olimorris commented on September 26, 2024

Thanks for raising the issue and testing. Great edge case!

from onedarkpro.nvim.

Arjun31415 avatar Arjun31415 commented on September 26, 2024

Glad to help

from onedarkpro.nvim.

Related Issues (20)

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.