From c44550249b85307f668aff0d356c3461856c0e49 Mon Sep 17 00:00:00 2001 From: rebuilt Date: Sun, 10 Oct 2021 09:59:01 +0200 Subject: fix(nvimtree): change 0 and 1 values to true/false (#1728) --- lua/core/nvimtree.lua | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'lua/core/nvimtree.lua') diff --git a/lua/core/nvimtree.lua b/lua/core/nvimtree.lua index 55cc6175..efed03d1 100644 --- a/lua/core/nvimtree.lua +++ b/lua/core/nvimtree.lua @@ -6,13 +6,13 @@ function M.config() active = true, on_config_done = nil, setup = { - open_on_setup = 0, - auto_close = 1, - open_on_tab = 0, + open_on_setup = false, + auto_close = true, + open_on_tab = false, update_focused_file = { - enable = 1, + enable = true, }, - lsp_diagnostics = 1, + lsp_diagnostics = true, view = { width = 30, side = "left", @@ -23,18 +23,18 @@ function M.config() }, }, show_icons = { - git = 1, - folders = 1, - files = 1, - folder_arrows = 1, + git = true, + folders = true, + files = true, + folder_arrows = true, tree_width = 30, }, ignore = { ".git", "node_modules", ".cache" }, - quit_on_open = 0, - hide_dotfiles = 1, - git_hl = 1, + quit_on_open = false, + hide_dotfiles = true, + git_hl = true, root_folder_modifier = ":t", - allow_resize = 1, + allow_resize = true, auto_ignore_ft = { "startify", "dashboard" }, icons = { default = "", @@ -73,11 +73,11 @@ function M.setup() -- Implicitly update nvim-tree when project module is active if lvim.builtin.project.active then - lvim.builtin.nvimtree.respect_buf_cwd = 1 - lvim.builtin.nvimtree.setup.update_cwd = 1 - lvim.builtin.nvimtree.setup.disable_netrw = 0 - lvim.builtin.nvimtree.setup.hijack_netrw = 0 - vim.g.netrw_banner = 0 + lvim.builtin.nvimtree.respect_buf_cwd = true + lvim.builtin.nvimtree.setup.update_cwd = true + lvim.builtin.nvimtree.setup.disable_netrw = false + lvim.builtin.nvimtree.setup.hijack_netrw = false + vim.g.netrw_banner = false end local tree_cb = nvim_tree_config.nvim_tree_callback -- cgit v1.2.3 From 8c03df505f63c5b326f16e63e06eb86023153868 Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Sun, 10 Oct 2021 14:04:06 +0330 Subject: fix: nvim-tree ls_disagnostics has been replaced with diagnostic (#1731) --- lua/core/nvimtree.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lua/core/nvimtree.lua') diff --git a/lua/core/nvimtree.lua b/lua/core/nvimtree.lua index efed03d1..048e25f7 100644 --- a/lua/core/nvimtree.lua +++ b/lua/core/nvimtree.lua @@ -12,7 +12,15 @@ function M.config() update_focused_file = { enable = true, }, - lsp_diagnostics = true, + diagnostics = { + enable = true, + icons = { + hint = "", + info = "", + warning = "", + error = "", + }, + }, view = { width = 30, side = "left", -- cgit v1.2.3 From e2c85df440564a62fd804555747b1652a6844a5e Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Sun, 10 Oct 2021 14:25:38 +0330 Subject: fix: anything not in setup should be set using zero and one (#1733) --- lua/core/nvimtree.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lua/core/nvimtree.lua') diff --git a/lua/core/nvimtree.lua b/lua/core/nvimtree.lua index 048e25f7..2d131147 100644 --- a/lua/core/nvimtree.lua +++ b/lua/core/nvimtree.lua @@ -31,18 +31,18 @@ function M.config() }, }, show_icons = { - git = true, - folders = true, - files = true, - folder_arrows = true, + git = 1, + folders = 1, + files = 1, + folder_arrows = 1, tree_width = 30, }, ignore = { ".git", "node_modules", ".cache" }, - quit_on_open = false, - hide_dotfiles = true, - git_hl = true, + quit_on_open = 0, + hide_dotfiles = 1, + git_hl = 1, root_folder_modifier = ":t", - allow_resize = true, + allow_resize = 1, auto_ignore_ft = { "startify", "dashboard" }, icons = { default = "", @@ -81,7 +81,7 @@ function M.setup() -- Implicitly update nvim-tree when project module is active if lvim.builtin.project.active then - lvim.builtin.nvimtree.respect_buf_cwd = true + lvim.builtin.nvimtree.respect_buf_cwd = 1 lvim.builtin.nvimtree.setup.update_cwd = true lvim.builtin.nvimtree.setup.disable_netrw = false lvim.builtin.nvimtree.setup.hijack_netrw = false -- cgit v1.2.3 From 52b74557415eb757ad4b7481b0aec8a3f98dd58d Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Sun, 10 Oct 2021 21:07:41 +0200 Subject: feat: add an independent lvim namespace (#1699) --- lua/core/nvimtree.lua | 141 -------------------------------------------------- 1 file changed, 141 deletions(-) delete mode 100644 lua/core/nvimtree.lua (limited to 'lua/core/nvimtree.lua') diff --git a/lua/core/nvimtree.lua b/lua/core/nvimtree.lua deleted file mode 100644 index 2d131147..00000000 --- a/lua/core/nvimtree.lua +++ /dev/null @@ -1,141 +0,0 @@ -local M = {} -local Log = require "core.log" - -function M.config() - lvim.builtin.nvimtree = { - active = true, - on_config_done = nil, - setup = { - open_on_setup = false, - auto_close = true, - open_on_tab = false, - update_focused_file = { - enable = true, - }, - diagnostics = { - enable = true, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - view = { - width = 30, - side = "left", - auto_resize = false, - mappings = { - custom_only = false, - }, - }, - }, - show_icons = { - git = 1, - folders = 1, - files = 1, - folder_arrows = 1, - tree_width = 30, - }, - ignore = { ".git", "node_modules", ".cache" }, - quit_on_open = 0, - hide_dotfiles = 1, - git_hl = 1, - root_folder_modifier = ":t", - allow_resize = 1, - auto_ignore_ft = { "startify", "dashboard" }, - icons = { - default = "", - symlink = "", - git = { - unstaged = "", - staged = "S", - unmerged = "", - renamed = "➜", - deleted = "", - untracked = "U", - ignored = "◌", - }, - folder = { - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - }, - }, - } -end - -function M.setup() - local status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") - if not status_ok then - Log:error "Failed to load nvim-tree.config" - return - end - local g = vim.g - - for opt, val in pairs(lvim.builtin.nvimtree) do - g["nvim_tree_" .. opt] = val - end - - -- Implicitly update nvim-tree when project module is active - if lvim.builtin.project.active then - lvim.builtin.nvimtree.respect_buf_cwd = 1 - lvim.builtin.nvimtree.setup.update_cwd = true - lvim.builtin.nvimtree.setup.disable_netrw = false - lvim.builtin.nvimtree.setup.hijack_netrw = false - vim.g.netrw_banner = false - end - - local tree_cb = nvim_tree_config.nvim_tree_callback - - if not lvim.builtin.nvimtree.setup.view.mappings.list then - lvim.builtin.nvimtree.setup.view.mappings.list = { - { key = { "l", "", "o" }, cb = tree_cb "edit" }, - { key = "h", cb = tree_cb "close_node" }, - { key = "v", cb = tree_cb "vsplit" }, - } - end - - lvim.builtin.which_key.mappings["e"] = { "NvimTreeToggle", "Explorer" } - - local tree_view = require "nvim-tree.view" - - -- Add nvim_tree open callback - local open = tree_view.open - tree_view.open = function() - M.on_open() - open() - end - - vim.cmd "au WinClosed * lua require('core.nvimtree').on_close()" - - if lvim.builtin.nvimtree.on_config_done then - lvim.builtin.nvimtree.on_config_done(nvim_tree_config) - end - require("nvim-tree").setup(lvim.builtin.nvimtree.setup) -end - -function M.on_open() - if package.loaded["bufferline.state"] and lvim.builtin.nvimtree.setup.view.side == "left" then - require("bufferline.state").set_offset(lvim.builtin.nvimtree.setup.view.width + 1, "") - end -end - -function M.on_close() - local buf = tonumber(vim.fn.expand "") - local ft = vim.api.nvim_buf_get_option(buf, "filetype") - if ft == "NvimTree" and package.loaded["bufferline.state"] then - require("bufferline.state").set_offset(0) - end -end - -function M.change_tree_dir(dir) - local lib_status_ok, lib = pcall(require, "nvim-tree.lib") - if lib_status_ok then - lib.change_dir(dir) - end -end - -return M -- cgit v1.2.3