Skip setting overlays on collapsed fragments#585
Conversation
Partial resolution of xenodium#584
e215c2c to
44ff21e
Compare
| (map-put! state :collapsed new-collapsed-state) | ||
| (put-text-property (map-elt block :start) | ||
| (map-elt block :end) 'agent-shell-ui-state state))))) | ||
| (map-elt block :end) 'agent-shell-ui-state state) |
There was a problem hiding this comment.
agent-shell-ui.el is fairly generic in enabling buffer updates through collapsable fragements. With this change, we'd be introducing client-specific logic.
I'd prefer if we found a way to keep markdown-specific logic in agent-shell.el. Maybe through an agent-shell-ui-post-toggle-fragment-at-point-function (hook) that we funcall from here? Happy to consider alternatives.
|
Thanks a lot for the PR! Source block highlighting in markdown-overlays.el is highly inneficient. I'm working on a separate markdown rendering solution but that will take a little more time. I'll push it to a branch somewhat soon. WRT to the PR itself, I'm happy to merge for the time being but could we please address the comment in review? Alternatively, isn't agent-shell-highlight-blocks set to nil enough to improve the immediate issue? |
c4a2fe4 to
44ff21e
Compare
|
Thank you for the follow-up changes. Could you resolve the conflicts so they can merged? |
Partial resolution of #584
Before:
After:
redisplay is no longer throttled and we save ~1GB of garbage on a 32k fragment length. CPU usage is still high but it's no longer causing major UI stutter. Expanded fragments still need help and there's probably some more optimization that could be done for both cases.
Checklist
M-x checkdocandM-x byte-compile-file.