Skip to content

Chore/move renderer globals - Round 2 #1280

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

Merged

Conversation

alex-courtis
Copy link
Member

@alex-courtis alex-courtis commented May 22, 2022

Merge #1279 first.

Simplifies a lot.

help doc has some bad formatting, mixing tabs and spaces. I'll fix the whole file later.

@@ -1,61 +0,0 @@
local M = {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goodbye

function M.setup(opts)
M.config = opts.renderer.icons

M.devicons = pcall(require, "nvim-web-devicons") and require "nvim-web-devicons"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only needed once.

@@ -146,21 +143,17 @@ local function get_highlight_(node)
return git_hl[git_status]
end

M.get_icons = nil_
M.get_highlight = nil_
function M.setup(opts)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reload was unnecessary; these can be set once.

@@ -84,9 +83,6 @@ local function get_links()
end

function M.setup()
if icons.get_config().show_file_icon and icons.get_config().has_devicons then
require("nvim-web-devicons").setup()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to nvim-tree.setup

@alex-courtis alex-courtis changed the title remove renderer globals: nvim_tree_show_icons, nvim_tree_show_icons Chore/move renderer globals - Round 2 May 22, 2022
@@ -131,6 +131,35 @@ Values may be functions. Warning: this may result in unexpected behaviour.
git_placement = "before",
padding = " ",
symlink_arrow = " ➛ ",
show = {
file = true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plurals were removed e.g. files -> file, as they were inconsistent.

folder_arrow = true,
git = true,
},
symbols = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renderer.icons.symbols was the best name I could think of. Ideas welcome.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good to me :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry... changed my mind... glyphs now.

Matches https://www.nerdfonts.com/ wording.

@alex-courtis alex-courtis merged commit 42597be into chore/move-renderer-globals May 23, 2022
@alex-courtis alex-courtis deleted the chore/move-renderer-globals-2 branch December 16, 2022 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants