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

Custom Icon style color are not maintained after entering normal mode #1472

Open
2 tasks done
CRAG666 opened this issue Jun 20, 2024 · 7 comments
Open
2 tasks done

Custom Icon style color are not maintained after entering normal mode #1472

CRAG666 opened this issue Jun 20, 2024 · 7 comments
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@CRAG666
Copy link

CRAG666 commented Jun 20, 2024

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

v0.10.0

Neorg setup

return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "norg", "norg_meta" })
end
end,
},
{
"nvim-neorg/neorg",
version = "*", -- Pin Neorg to the latest stable release
dependencies = { "luarocks.nvim", "nvim-neorg/neorg-telescope" },
cmd = "Neorg",
ft = "norg",
keys = {
{
neorg_leader .. "o",
function()
if neorg_enabled then
vim.cmd ":Neorg return"
neorg_enabled = false
return
end
vim.cmd "Neorg workspace notes"
neorg_enabled = true
end,
desc = "Toggle org notes",
},
{
neorg_leader .. "tt",
function()
-- if vim.w.toc_open then
-- vim.api.nvim_win_close(vim.w.win_toc, false)
-- vim.w.toc_open = false
-- return
-- end
vim.cmd "Neorg toc"
vim.cmd "vert resize 60"
-- vim.w.win_toc = vim.api.nvim_win_get_number(0)
-- vim.w.toc_open = true
end,
desc = "Toggle highlighting org",
},
},
config = function()
require("neorg").setup {
load = {
["core.defaults"] = {}, -- Loads default behaviour
["core.completion"] = { config = { engine = "nvim-cmp", name = "[Norg]" } },
["core.integrations.nvim-cmp"] = {},
["core.concealer"] = {
config = {
-- icon_preset = "basic",
icon_preset = "diamond",
icons = {
code_block = {
conceal = true,
},
-- heading = {
-- icons = { "🌸", "🌼", "🏵️", "❇️", "💠", "◉" },
-- },
},
},
},
["core.dirman"] = { -- Manages Neorg workspaces
config = {
workspaces = {
notes = "~/Documentos/Org/Notes",
},
},
},
["core.keybinds"] = {
config = {
neorg_leader = neorg_leader,
hook = function(keybinds)
keybinds.map_event_to_mode("norg", {

              n = { -- Bind keys in normal mode
                {
                  neorg_leader .. "fl",
                  "core.integrations.telescope.find_linkable",
                  opts = { desc = "Find linkable" },
                },
                {
                  neorg_leader .. "fh",
                  "core.integrations.telescope.search_headings",
                  opts = { desc = "Search headings" },
                },
                {
                  neorg_leader .. "fi",
                  "core.integrations.telescope.insert_link",
                  opts = { desc = "Insert link" },
                },
                {
                  neorg_leader .. "ff",
                  "core.integrations.telescope.insert_file_link",
                  opts = { desc = "Insert link" },
                },
                { "]l", "core.integrations.treesitter.next.link", opts = { desc = "Next link" } },
                { "[l", "core.integrations.treesitter.previous.link", opts = { desc = "Previous link" } },
              },

              i = { -- Bind in insert mode
                { "<C-l>", "core.integrations.telescope.insert_link", opts = { desc = "Insert link" } },
              },
            }, {
              silent = true,
              noremap = true,
            })
          end,
        },
      },
      ["core.summary"] = {},
      ["core.export"] = {},
      ["core.integrations.telescope"] = {},
      ["core.ui.calendar"] = {},
    },
  }
end,

},

Actual behavior

Icons are not consistent between different modes

Expected behavior

Icons are expected to always be the same

Steps to reproduce

Open Org and hover heading

Potentially conflicting plugins

No response

Other information

No response

Help

Yes

Implementation help

No response

@CRAG666 CRAG666 added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Jun 20, 2024
@CRAG666
Copy link
Author

CRAG666 commented Jun 20, 2024

Diamong config:
2024-06-19T22:37:54,212676152-06:00

Error:

2024-06-19T22:38:02,668763599-06:00

@benlubas
Copy link
Contributor

When I go into normal mode in a heading line, the concealer disables and I see * heading name

What happens for me is the expected behavior afaik.

@CRAG666
Copy link
Author

CRAG666 commented Jun 22, 2024

@benlubas That's what I would expect but the opposite happens, I didn't have those problems in version 7. I disabled treesitter, but the problem prevails, so I came to the conclusion that the error is part of this plugin

@benlubas
Copy link
Contributor

Yeah I can't reproduce it. I'd recommend making a minimal config, and if you still see it happening then I can try the minimal config, otherwise it's likely something specific to your config.

@CRAG666
Copy link
Author

CRAG666 commented Jun 25, 2024

@benlubas The initial error is already solved, now the error is that when I am in normal mode the color of the icon changes, when I defined it with another color

@CRAG666
Copy link
Author

CRAG666 commented Jun 25, 2024

Normal and insert mode:
2024-06-24T20:09:56,088020109-06:00
Command mode:
2024-06-24T20:10:02,481069807-06:00

@CRAG666
Copy link
Author

CRAG666 commented Jun 25, 2024

catppuccin config:

            ["@neorg.lists.unordered.prefix.norg"] = { fg = C.mauve },

            ["@neorg.headings.1.title.norg"] = { fg = C.pink },
            ["@neorg.headings.1.prefix"] = { fg = C.pink },
            ["@neorg.headings.1.prefix.norg"] = { fg = C.pink },
            ["@neorg.links.location.heading.1.norg"] = { fg = C.pink },

            ["@neorg.headings.2.title.norg"] = { fg = C.yellow },
            ["@neorg.headings.2.prefix"] = { fg = C.yellow },
            ["@neorg.headings.2.prefix.norg"] = { fg = C.yellow },
            ["@neorg.links.location.heading.2.norg"] = { fg = C.yellow },

            ["@neorg.headings.3.title.norg"] = { fg = C.sky },
            ["@neorg.headings.3.prefix"] = { fg = C.sky },
            ["@neorg.headings.3.prefix.norg"] = { fg = C.sky },
            ["@neorg.links.location.heading.3.norg"] = { fg = C.sky },

            ["@neorg.headings.4.title.norg"] = { fg = C.green },
            ["@neorg.headings.4.prefix"] = { fg = C.green },
            ["@neorg.headings.4.prefix.norg"] = { fg = C.green },
            ["@neorg.links.location.heading.4.norg"] = { fg = C.green },

            ["@neorg.headings.5.title.norg"] = { fg = C.lavender },
            ["@neorg.headings.5.prefix"] = { fg = C.lavender },
            ["@neorg.headings.5.prefix.norg"] = { fg = C.lavender },
            ["@neorg.links.location.heading.5.norg"] = { fg = C.lavender },

Neorg config:

  {
    "nvim-neorg/neorg",
    dependencies = { "luarocks.nvim", "nvim-neorg/neorg-telescope" },
    cmd = "Neorg",
    ft = "norg",
    keys = {
      {
        neorg_leader .. "o",
        function()
          if neorg_enabled then
            vim.cmd.Neorg "return"
            neorg_enabled = false
            return
          end
          vim.cmd.Neorg.workspace "notes"
          neorg_enabled = true
        end,
        desc = "Toggle org notes",
      },
      {
        neorg_leader .. "c",
        function()
          vim.cmd.Neorg "toggle-concealer"
        end,
        desc = "Toggle highlighting org",
      },
      {
        neorg_leader .. "tt",
        function()
          -- if vim.w.toc_open then
          --   vim.api.nvim_win_close(vim.w.win_toc, false)
          --   vim.w.toc_open = false
          --   return
          -- end
          vim.cmd.Neorg "toc"
          vim.cmd "vert resize 60"
          -- vim.w.win_toc = vim.api.nvim_win_get_number(0)
          -- vim.w.toc_open = true
        end,
        desc = "Toggle highlighting org",
      },
    },
    config = function()
      require("neorg").setup {
        load = {
          ["core.defaults"] = {}, -- Loads default behaviour
          ["core.completion"] = { config = { engine = "nvim-cmp", name = "[Norg]" } },
          ["core.integrations.nvim-cmp"] = {},
          ["core.concealer"] = {
            config = {
              icon_preset = "basic",
              -- icon_preset = "diamond",
              icons = {
                code_block = {
                  conceal = true,
                },
                delimiter = {
                  horizontal_line = {
                    icon = "",
                  },
                },
                -- todo = {
                --   cancelled = { icon = "🚫" },
                --   done = { icon = "✅" },
                --   undone = { icon = "🕒" },
                --   on_hold = { icon = "⏸️" },
                --   pending = { icon = "⏳" },
                --   recurring = { icon = "🔄" },
                --   uncertain = { icon = "❓" },
                --   urgent = { icon = "🚨" },
                -- },
                definition = {
                  single = { icon = "󰃃" },
                  multi_prefix = { icon = "󰉾 " },
                  multi_suffix = { icon = "󰝗 " },
                },
                list = {
                  icons = { "" },
                },
                quote = {
                  icons = { "󰇙" },
                },
                heading = {
                  icons = { "🌸 ", "🌼 ", "💠 ", "🍀 ", "󰴈", "" },
                },
              },
            },
          },
          ["core.dirman"] = { -- Manages Neorg workspaces
            config = {
              workspaces = {
                notes = "~/Documentos/Org/Notes",
              },
            },
          },
          ["core.keybinds"] = {
            config = {
              neorg_leader = neorg_leader,
              hook = function(keybinds)
                keybinds.map_event_to_mode("norg", {

                  n = { -- Bind keys in normal mode
                    {
                      neorg_leader .. "fl",
                      "core.integrations.telescope.find_linkable",
                      opts = { desc = "Find linkable" },
                    },
                    {
                      neorg_leader .. "fh",
                      "core.integrations.telescope.search_headings",
                      opts = { desc = "Search headings" },
                    },
                    {
                      neorg_leader .. "fi",
                      "core.integrations.telescope.insert_link",
                      opts = { desc = "Insert link" },
                    },
                    {
                      neorg_leader .. "ff",
                      "core.integrations.telescope.insert_file_link",
                      opts = { desc = "Insert link" },
                    },
                    { "]l", "core.integrations.treesitter.next.link", opts = { desc = "Next link" } },
                    { "[l", "core.integrations.treesitter.previous.link", opts = { desc = "Previous link" } },
                  },

                  i = { -- Bind in insert mode
                    { "<C-l>", "core.integrations.telescope.insert_link", opts = { desc = "Insert link" } },
                  },
                }, {
                  silent = true,
                  noremap = true,
                })
              end,
            },
          },
          ["core.summary"] = {},
          ["core.export"] = {},
          ["core.integrations.telescope"] = {},
          ["core.ui.calendar"] = {},
        },
      }
    end,
  },

@CRAG666 CRAG666 changed the title Heading icons are not maintained in different modes Custom styles are not maintained after entering normal mode Jun 25, 2024
@CRAG666 CRAG666 changed the title Custom styles are not maintained after entering normal mode Custom Icon style color are not maintained after entering normal mode Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
Development

No branches or pull requests

2 participants