-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
API/UI: ui_event_extmark #15674
API/UI: ui_event_extmark #15674
Conversation
|
@justinmk not doing it in Also this is the first WIP draft from someone who is relatively new to the C code (and a pretty good one, for that). Let's take some time to clean it up and simplify some things (like the "lookless" stuff should just be reduced into ordinary decorations), before passing it off as too special and noisy and attempting a different implementation from scratch, which are bound to have other complexities, like re-calculating all positions which simply are just there for us for free inside the |
This comment has been minimized.
This comment has been minimized.
@justinmk initially I proposed exactly that |
Makes sense. Keeping it mind that nothing I say is blocking this PR, I wonder if ...
Thus the signature might be:
|
In my mind, "watch" is for a specific type of message, and "attach" is like a whole-sale solution -- attach to buffer means to receive everything related to the buffer. Also, this is ui-specific (hence Edit: "watch" doesn't carry the idea that we want grid cell positions either... Thoughts? |
@bfredl a few thoughts for dc0e7fa: I understand that non-text marks should be filtered as early as possible, so I moved it out from "lookless" stuff has been merged with ordinary decors. Debugged this a few rounds, the "lookless marks" do not have altpos (set to -1). The decor adding predicates are updated accordingly. TODO: can get even earlier? -- put |
one more edge case fixed -- when the viewport scrolls up but there's no text updates (all empty lines), invalidate extmarks. |
but there are still more. Higher order ones 🙀 |
828191d
to
1f93bc7
Compare
my conclusion is that it's not appropriate to send win_extmarks_clear in win_update because it's incremental and does not have the full information of the window. |
that's fine. as extmarks are anchored to cell grids, they will be cleared when the line is redrawn, and should also scroll with the line (i e it should be treated as an extra attribute to the cell). |
A frontend can implement something like this: so there are two sets of tracked extmarks -- one is for those associated with the on-screen cells, and the other is for scrolled-out ones which can be tracked with win_viewport. This allows image display clipped by window top. |
289c82f
to
e5e2622
Compare
@bfredl rebased on virtual lines. |
9783934
to
ac368e8
Compare
5c29ad6
to
cd2690f
Compare
cd2690f
to
e9786ca
Compare
e9786ca
to
217fbec
Compare
@yatli would you mind write a simple test or two? I'm happy to give guidance as needed. |
Wilco. I was waiting for the shape of this PR to settle down before moving to tests, and it looks like the time is now. |
@bfredl how do I receive events from a screen(ui)? I see there's also Not sure which one to use. Edit: @yatli look here in case you forget:
|
@yatli indeed. instead of trying to "intercept" screen.lua, we have to implement support there, perhaps not too unlike how a "real" UI would. so we should write a function like |
@yatli try |
The event is present. |
oka removed |
@bfredl tests ready |
235b669
to
612c3fe
Compare
Done the changes. Is that what you mean by "checked multiple times"? That the error should not break the execution flow. |
yes. it will check against the conditions each time there is a "flush" event. so it must be prepared to check state multiple times. than |
Thanks, merged! We might want more docs/tests for how to properly interact with |
No description provided.