Skip to content

Conversation

@apollo1321
Copy link
Contributor

Should fix this issue: #512 (comment)

---@param winid integer
local update_single_context = throttle_by_id(function(winid)
-- Remove leaked contexts firstly.
require('treesitter-context.render').close_leaked_contexts()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is pretty simple, I'm not sure if it worth creating separate throttler for closing leaked contexts.

@apollo1321 apollo1321 marked this pull request as draft November 17, 2024 17:16
@apollo1321 apollo1321 marked this pull request as ready for review November 17, 2024 17:29

local M = {}

-- Contexts may sometimes leak due to reasons like the use of 'noautocmd'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should be putting in provisions for handling noautocmd cases. If a bug is caused by noautocmd, then it means it was used incorrectly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly. However, I’m not sure how to reproduce this bug. satellite.nvim has similar protection, which might contribute to its reliability.
https://github.com/lewis6991/satellite.nvim/blob/main/lua/satellite/view.lua#L260

@lewis6991 lewis6991 merged commit 1147c42 into nvim-treesitter:master Nov 18, 2024
2 checks passed
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