Skip to content
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(ui): allow to get the highlight namespace (rebase of #24390) #25455

Merged
merged 1 commit into from
Oct 1, 2023

Conversation

bfredl
Copy link
Member

@bfredl bfredl commented Oct 1, 2023

closes #24390

@github-actions github-actions bot added the ui label Oct 1, 2023
@github-actions github-actions bot requested a review from famiu October 1, 2023 08:11
@bfredl bfredl merged commit 9b30451 into neovim:master Oct 1, 2023
12 of 14 checks passed
@github-actions github-actions bot removed the request for review from famiu October 1, 2023 08:39
@@ -979,6 +979,19 @@ nvim_get_hl_id_by_name({name}) *nvim_get_hl_id_by_name()*

similar to |hlID()|, but allocates a new ID if not present.

nvim_get_hl_ns({*opts}) *nvim_get_hl_ns()*
Copy link
Member

Choose a reason for hiding this comment

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

In #24390 (comment) there was an open question about naming this nvim_get_ns.

Why do we need highlight-specific namespace functions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Strictly speaking, we didn't "need" highlight namespaces to begin with, we added them because it was something we wanted (it is a little fun).

The more complex involved answer is, if we had window-local options which actually worked (with a mode where they're actually being local to the window, which I plan to work on "soon"), then hl_ns could just have been yet another global-local option. But in the meanwhile, having API functions ilke nvim_set/get_hl_ns to get and set the current highlight namespace seems like the best option. I don't see how they generalize to other uses of namespaces, and thus removing "hl" out of the the name would only hurt discoverability and understanding of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants