feat: trigger TextChanged event after updating buffer #474
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Details
Some users (or at least 1) use a plugin I own render-markdown.nvim to view ChatGPT sessions. My plugin adds some highlights and icons to improve viewing markdown in neovim.
When a session is changed from the sessions panel the
nvim_buf_set_lines
API is called which updates the contents of the buffer. However on my plugin's side I am unable to "see" that anything changed so do not update the rendering leading to this issue: MeanderingProgrammer/render-markdown.nvim#210.To bridge this gap I added a manual trigger of the
TextChanged
event after the API call which lets my plugin re-render the buffer.LMK if there are any concerns with the change or if there is another approach I can take, thank you!