-
-
Notifications
You must be signed in to change notification settings - Fork 619
feat(#2349): add "right_align" option for renderer.icons.*_placement #2846
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
feat(#2349): add "right_align" option for renderer.icons.*_placement #2846
Conversation
… using ext_marks nvim api
… using ext_marks nvim api feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api
…full_name features
bde9b46
to
cb56c0d
Compare
right_align
and full_name
feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for the quick turnaround!
@@ -13,12 +13,13 @@ local M = {} | |||
local SIGN_GROUP = "NvimTreeRendererSigns" | |||
|
|||
local namespace_id = vim.api.nvim_create_namespace "NvimTreeHighlights" | |||
local namespace_extmarks_id = vim.api.nvim_create_namespace "NvimTreeExtmarks" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find.
Could we play this a bit safer and have a separate namespace for full-name as well?
It's using "NvimTreeHighlights"
which is a little concerning now that we've learned of the namespace sharing difficulties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to rename it too, indeed, doesn't have to happen here though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at the the namespace usage in full_name.lua
, and it seems to rely on the NvimTreeHighlights
namespace being set up beforehand. I thought this because of line 69:
local extmarks = vim.api.nvim_buf_get_extmarks(0, ns_id, { line_nr - 1, 0 }, { line_nr - 1, -1 }, { details = true })
Because of that I don't think I can introduce a separate namespace for full_name rn, also
I did not wrote any code in that file I'm not so sure what I could safely change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough; there may all sorts of assumptions there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right_align
and full_name
feature…lacement (nvim-tree#2846) * feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api * feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api * feat(icon_placement): consolidate doc * fix: extra namespace added to avoid colision between right_align and full_name features * style: rename namespace_id --------- Co-authored-by: Alexander Courtis <[email protected]>
…files below the tree (#2856) * feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api * feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api * feat(icon_placement): consolidate doc * fix: extra namespace added to avoid colision between right_align and full_name features * feat(hidden_display): Allow fine grained rendering of hidden files in a folder * feat(hidden_display): update defaults in Builder to allow rendering * feat(hidden_display): Rename opts function name for the feature * feat(#2349): add "right_align" option for renderer.icons.*_placement (#2846) * feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api * feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api * feat(icon_placement): consolidate doc * fix: extra namespace added to avoid colision between right_align and full_name features * style: rename namespace_id --------- Co-authored-by: Alexander Courtis <[email protected]> * docs: update docs * feat(hidden_display): Simplification and better performance by not sorting and grouping virtual lines * Update doc/nvim-tree-lua.txt Co-authored-by: Alexander Courtis <[email protected]> * style: hidden_stats is better * docs: change to hidden_stats * add separate namespace for virtual lines * help: add highlight group --------- Co-authored-by: Alexander Courtis <[email protected]>
Context:
The feature from PR #2839 was merged but quickly reverted due to a bug caused by a namespace collision with
full_name
rendering whenrenderer.full_name
is enabled. This PR addresses the issue by adding a separate namespace and also syncs with the current nvim-tree master branch.