VSCodeVim / VSCodeVim/Vim

Fold commands (zo, zc) are broken in v1.24.3

Open
#8,130 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

Describe the bug

Analog to #7797 Im getting the following error when trying to zo, zc

Failed to handle key `c`: argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true

To Reproduce
Steps to reproduce the behavior:

  1. Enable .vimrc support
  2. create following mappings:
nnoremap zc editor.fold
nnoremap zo editor.unfold
  1. zo/zc inside a codeblock/function
  2. See error popup, codeblock not folded

Expected behavior
Codeblock folded

Environment (please complete the following information):

  • Extension (VsCodeVim) version: v1.24.3
  • VSCode version: 1.73
  • OS: windows 10

Additional Notes

  • VScode keyboard shortcuts fold as expected using same command id
  • rebinding to other keys does not help
  • The following editor.(un-)foldAll mappings work as expected
nnoremap <leader>zc editor.foldAll
nnoremap <Leader>zo editor.unfoldAll

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with VSCodeVim v1.24.3 by enabling .vimrc support and mapping zo to editor.fold and zc to editor.unfold inside a code block or function. Compare these mappings with the working editor.foldAll and editor.unfoldAll mappings; done means zo and zc fold and unfold without the argument-constraint error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.