Skip to content

fix(#2507): icon in message after rename-file #2510

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
merged 3 commits into from
Nov 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lua/nvim-tree/actions/fs/rename-file.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function M.rename(node, to)
if not success then
return notify.warn(err_fmt(notify_from, notify_to, err))
end
notify.info(notify_from .. "  " .. notify_to)
notify.info(string.format("%s -> %s", notify_from, notify_to))
utils.rename_loaded_buffers(node.absolute_path, to)
events._dispatch_node_renamed(node.absolute_path, to)
end
Expand All @@ -53,7 +53,9 @@ function M.fn(default_modifier)

-- support for only specific modifiers have been implemented
if not ALLOWED_MODIFIERS[modifier] then
return notify.warn("Modifier " .. vim.inspect(modifier) .. " is not in allowed list : " .. table.concat(ALLOWED_MODIFIERS, ","))
return notify.warn(
string.format("Modifier %s is not in allowed list: %s", vim.inspect(modifier), table.concat(ALLOWED_MODIFIERS, ","))
Copy link
Collaborator

Choose a reason for hiding this comment

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

As @gegoune said in #2508, this is a change outside of the scope of your PR. Using string.format here is arguably better, but it should be done in a separate refactoring.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am sorry. I understood gegoune's words to fix that as well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, now that I think about it, I'm not sure if the "same here" is about the unrelated style changes or the use of string.format... Let's wait for his feedback.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay and I finally understand your FYI. Thank you for your kindness.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Apologies if I wasn't clear enough. My fault.

Regarding unrelated changes: I meant it for formatting changes toward the top of file.

string.format is what we should be using going forward but as @Akmadan23 said existing code should not be changed as part of that pr to make it self contained. We can replace other string concatenations across code base in separate pr (I can do it).

Hope that clears things up. Thanks for your pr!

)
end

node = lib.get_last_group_node(node)
Expand Down