Skip to content

feat(experimental): window scoped extmark#50

Draft
IndianBoy42 wants to merge 1 commit intocbochs:mainfrom
IndianBoy42:window_extmark
Draft

feat(experimental): window scoped extmark#50
IndianBoy42 wants to merge 1 commit intocbochs:mainfrom
IndianBoy42:window_extmark

Conversation

@IndianBoy42
Copy link

Neovim nightly is starting to add support for window-scoped extmarks. This PR uses it to make the portal windows a little cleaner.
It is a very experimental API under active discussion.
Definitely don't need to merge, just putting this here for people to know because I think it makes a lot of sense for portal.nvim.

@chuan29812
Copy link

could be a longshot, what exactly does this accomplish? i tried adding your commit to mine, the nvim__ is already obsolete. I tried adding scoped, but dont see any different.

@IndianBoy42
Copy link
Author

Previously/currently extmarks are scoped to a buffer, which means they are anchored to a certain buffer, line, column. If the buffer is displayed in multiple windows (including floating windows) then the extmark shows up in all of them. With window scoped extmarks it would be anchored to a window, row, column or a buffer, line, column, window making it only show up in that one window (don't remember off the top of my head how it works in nvim, haven't touched plugin stuff in a while). To me that is cleaner for portal.nvim because we can make it show up only in the active window or the floating windows

@IndianBoy42
Copy link
Author

IndianBoy42 commented May 27, 2025

For reference: neovim/neovim#27361 merged the change to make a namespace window local so that the extmarks inside them only show up in that window. The updated version of this PR should create namespaces for every window that the portal labels should show up in and add extmarks to that oh that is what I did, it just needs the updated name

@chuan29812
Copy link

chuan29812 commented May 27, 2025

image

@IndianBoy42 thanks for the reply. TIL, im guessing the h and k extmark just wouldnt be showing in the right window if its scoped to the buffer? btw, i tried only appending the scoped: true in the window.lua file, nothing changed. Probably requires more work. haha

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