Skip to content

fix(api): substitute calls on_bytes after modifying buffer#36650

Merged
github-actions[bot] merged 1 commit intorelease-0.11from
backport-36487-to-release-0.11
Nov 21, 2025
Merged

fix(api): substitute calls on_bytes after modifying buffer#36650
github-actions[bot] merged 1 commit intorelease-0.11from
backport-36487-to-release-0.11

Conversation

@neovim-backports
Copy link

Description

Backport of #36487 to release-0.11.

Problem: `extmark_splice()` was being called before `ml_replace()`,
which caused the on_bytes callback to be invoked with the old buffer
text instead of the new text.

Solution: store metadata for each match in a growing array, call
`ml_replace()` once to update the buffer, then call `extmark_splice()`
once per match.

Closes #36370.

(cherry picked from commit 7da4d6a)
@github-actions github-actions bot enabled auto-merge (rebase) November 21, 2025 05:40
@github-actions github-actions bot added api libnvim, Nvim RPC API target:release labels Nov 21, 2025
@github-actions github-actions bot merged commit da825e5 into release-0.11 Nov 21, 2025
31 checks passed
@github-actions github-actions bot deleted the backport-36487-to-release-0.11 branch November 21, 2025 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api libnvim, Nvim RPC API target:release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant