Skip to content

Conversation

@DragonXexe
Copy link

This PR fixes a bug where the next, prev, first, last, fold_reduce and fold_more would not be correctly affected by v:count1.

That was caused by the fact that these actions were called asynchronously. Because of that Neovim seems to reset the command specific context including count1.

How To Test

  1. Enter a trouble view,
  2. Then type 3]] or any other action with another count.
  3. This should now correctly peform the action with the count.

Description

This PR preserves count1 by passing it in the context of each action.
This will fix the issue and will also make the documentation, which states that these actions can use count, correct.

Related Issue(s)

Fixes #668

Added `count1` to trouble.Action.ctx.
This allows actions to use `count1` because of originally the context
from `vim.v.count1` is lost because of the `:next` call on the view.
@github-actions github-actions bot added the size/m Medium PR (<50 lines changed) label Dec 20, 2025
@DragonXexe DragonXexe changed the title fix: preserve count1 across async actions (Fixes #668) fix(actions): preserve count1 across async actions (Fixes #668) Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m Medium PR (<50 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: vim.v.count1 is not passed correctly to the api functions

1 participant