Skip to content

Modified Icon And Highlight Broken Following Highlight Overhaul #2637

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

Closed
alex-courtis opened this issue Jan 21, 2024 · 0 comments · Fixed by #2638
Closed

Modified Icon And Highlight Broken Following Highlight Overhaul #2637

alex-courtis opened this issue Jan 21, 2024 · 0 comments · Fixed by #2638
Labels
bug Something isn't working

Comments

@alex-courtis
Copy link
Member

Description

modified icon and all highlights not shown

Neovim version

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1702233742

Operating system and version

Linux 6.6.10-arch1-1

Windows variant

No response

nvim-tree version

75ff64e

Clean room replication

local M = {}

vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

vim.opt.termguicolors = true
vim.opt.cursorline = true

vim.opt.statusline = "b%{bufnr()} w%{winnr()} i%{win_getid()} %y %F"

vim.o.packpath = "/tmp/nvt-dev/site"
local package_root = vim.o.packpath .. "/pack"
local install_path = vim.o.packpath .. "/pack/packer/start/packer.nvim"
local compile_path = vim.o.packpath .. "/pack/packer/start/packer.nvim/plugin/packer_compiled.lua"

local bootstrapping = vim.fn.isdirectory(install_path) == 0

if bootstrapping then
  print("Bootstrapping...")
  vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path })
end

local packer = require("packer")

packer.init({
  package_root = package_root,
  compile_path = compile_path,
})

packer.use("wbthomason/packer.nvim")
packer.use({
  "neovim/nvim-lspconfig",
  "nvim-tree/nvim-web-devicons",
  -- 'nvim-tree/nvim-tree.lua',
  "/home/alex/src/nvim-tree/master",
})

if bootstrapping then
  vim.cmd([[
    autocmd User PackerComplete quitall
  ]])

  packer.sync()
  return
end

local api = require("nvim-tree.api")
local log = require("nvim-tree.log")

-- stylua: ignore start
vim.keymap.set("n", ";",        ":",                                   { noremap = true })
vim.keymap.set("n", "<space>a", function() api.tree.open({}) end,      { noremap = true })
vim.keymap.set("n", "<space>'", function() api.tree.find_file({}) end, { noremap = true })
vim.keymap.set("n", "<space>o", function() vim.cmd.wincmd("p") end,    { noremap = true })
-- stylua: ignore end

function M.on_attach(bufnr)
  local function opts(desc)
    return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
  end

  api.config.mappings.default_on_attach(bufnr)

  -- stylua: ignore start
  vim.keymap.set('n', '?',     api.tree.toggle_help,                  opts('Help'))
  -- stylua: ignore end
end

vim.api.nvim_create_autocmd("DirChanged", {
  callback = function(data)
    print(vim.inspect(data))
  end,
})

api.events.subscribe(api.events.Event.NodeRenamed, function(data)
  log.line("dev", "Event.NodeRenamed %s %s", data.old_name, data.new_name)
end)

vim.cmd([[
:hi NvimTreeRootFolder guifg=magenta
]])

require("lspconfig").lua_ls.setup({})

require("nvim-tree").setup({
  on_attach = M.on_attach,
  hijack_cursor = false,
  auto_reload_on_write = true,
  disable_netrw = false,
  hijack_netrw = true,
  hijack_unnamed_buffer_when_opening = false,
  root_dirs = {},
  prefer_startup_root = false,
  sync_root_with_cwd = false,
  reload_on_bufenter = false,
  respect_buf_cwd = false,
  select_prompts = false,
  sort = {
    sorter = "name",
    folders_first = true,
    files_first = false,
  },
  view = {
    centralize_selection = false,
    cursorline = true,
    debounce_delay = 15,
    side = "left",
    preserve_window_proportions = false,
    number = false,
    relativenumber = false,
    signcolumn = "yes",
    width = 30,
    float = {
      enable = false,
      quit_on_focus_loss = true,
      open_win_config = {
        relative = "editor",
        border = "rounded",
        width = 30,
        height = 30,
        row = 1,
        col = 1,
      },
    },
  },
  renderer = {
    add_trailing = false,
    group_empty = false,
    full_name = false,
    root_folder_label = ":~:s?$?/..?",
    indent_width = 2,
    special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
    symlink_destination = true,
    highlight_git = "none",
    highlight_diagnostics = "none",
    highlight_opened_files = "none",
    highlight_modified = "all",
    highlight_bookmarks = "none",
    highlight_clipboard = "name",
    indent_markers = {
      enable = false,
      inline_arrows = true,
      icons = {
        corner = "",
        edge = "",
        item = "",
        bottom = "",
        none = " ",
      },
    },
    icons = {
      web_devicons = {
        file = {
          enable = true,
          color = true,
        },
        folder = {
          enable = false,
          color = true,
        },
      },
      git_placement = "before",
      modified_placement = "signcolumn",
      diagnostics_placement = "signcolumn",
      bookmarks_placement = "signcolumn",
      padding = " ",
      symlink_arrow = "",
      show = {
        file = true,
        folder = true,
        folder_arrow = true,
        git = true,
        modified = true,
        diagnostics = true,
        bookmarks = true,
      },
      glyphs = {
        default = "",
        symlink = "",
        bookmark = "󰆤",
        modified = "",
        folder = {
          arrow_closed = "",
          arrow_open = "",
          default = "",
          open = "",
          empty = "",
          empty_open = "",
          symlink = "",
          symlink_open = "",
        },
        git = {
          unstaged = "",
          staged = "",
          unmerged = "",
          renamed = "",
          untracked = "",
          deleted = "",
          ignored = "",
        },
      },
    },
  },
  hijack_directories = {
    enable = true,
    auto_open = true,
  },
  update_focused_file = {
    enable = false,
    update_root = false,
    ignore_list = {},
  },
  system_open = {
    cmd = "",
    args = {},
  },
  git = {
    enable = true,
    show_on_dirs = true,
    show_on_open_dirs = true,
    disable_for_dirs = {},
    timeout = 400,
    cygwin_support = false,
  },
  diagnostics = {
    enable = true,
    show_on_dirs = false,
    show_on_open_dirs = true,
    debounce_delay = 50,
    severity = {
      min = vim.diagnostic.severity.HINT,
      max = vim.diagnostic.severity.ERROR,
    },
    icons = {
      hint = "",
      info = "",
      warning = "",
      error = "",
    },
  },
  modified = {
    enable = true,
    show_on_dirs = true,
    show_on_open_dirs = true,
  },
  filters = {
    git_ignored = true,
    dotfiles = false,
    git_clean = false,
    no_buffer = false,
    no_bookmark = false,
    custom = {},
    exclude = {},
  },
  live_filter = {
    prefix = "[FILTER]: ",
    always_show_folders = true,
  },
  filesystem_watchers = {
    enable = true,
    debounce_delay = 50,
    ignore_dirs = {},
  },
  actions = {
    use_system_clipboard = true,
    change_dir = {
      enable = true,
      global = false,
      restrict_above_cwd = false,
    },
    expand_all = {
      max_folder_discovery = 300,
      exclude = {},
    },
    file_popup = {
      open_win_config = {
        col = 1,
        row = 1,
        relative = "cursor",
        border = "shadow",
        style = "minimal",
      },
    },
    open_file = {
      quit_on_open = false,
      eject = true,
      resize_window = true,
      window_picker = {
        enable = true,
        picker = "default",
        chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
        exclude = {
          filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
          buftype = { "nofile", "terminal", "help" },
        },
      },
    },
    remove_file = {
      close_window = true,
    },
  },
  trash = {
    cmd = "gio trash",
  },
  tab = {
    sync = {
      open = false,
      close = false,
      ignore = {},
    },
  },
  notify = {
    threshold = vim.log.levels.INFO,
    absolute_path = true,
  },
  help = {
    sort_by = "key",
  },
  ui = {
    confirm = {
      remove = true,
      trash = true,
      default_yes = false,
    },
  },
  experimental = {},
  log = {
    enable = true,
    truncate = true,
    types = {
      all = false,
      config = false,
      copy_paste = false,
      dev = true,
      diagnostics = false,
      git = false,
      profile = false,
      watcher = false,
    },
  },
})

return M

Steps to reproduce

modify any file

Expected behavior

modified icon and modified highlight shown on file icon and text

Actual behavior

not shown in any case

@alex-courtis alex-courtis added the bug Something isn't working label Jan 21, 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.

1 participant