nvim-treesitter / nvim-treesitter/nvim-treesitter-context
Add `trim_scope = "center"`
Nobody has claimed this yet.
- Dominant language
- Janet
- Stars
- 3.2k
- Forks
- 241
- PR merge metrics
- No merged PRs in 30d
Description
When I'm handling a lot of if statements or switch cases, I often find myself either not knowing which function I'm in when dealing with others' codebases (outer), or which if/switch statement I'm in (inner). I'd love to see a feature to remove the context in the center, leaving only the appropriate number of inner and outer context lines, depending on how nested the code is, or how many if/switch statements there are and obviously the value of max_lines.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by locating the existing handling for trim_scope and max_lines, then define how center trimming should behave for nested if and switch contexts and how the resulting context lines should be verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vim
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100