[Feature Request] "Current File" not being called if specific code block is from same file (same context double)

I’ve been enjoying the feature that allows adding context from the terminal, providing extra information to help fix bugs. However, I’ve noticed an issue when selecting specific code blocks from the current file:

  1. If a portion of the current file is selected (e.g., using CMD+L), the full code block is still added, resulting in duplicate content.

  2. This duplication can lead to unnecessary repetition, especially problematic with large files (500+ lines).

  3. In some cases, this redundancy may cause output degradation.

]Feature Request]
Could you please optimize the context addition process to avoid duplicating content when specific code blocks are selected? Ideally, the system would:

  • Recognize when a selection is made within the current file.

  • Only include the selected portion in the context, rather than the entire file.

  • Prevent duplicate content when the current file is already part of the context.

This enhancement would streamline the context-adding process, reduce clutter, and potentially improve output quality for large codebases.

For example:


Two times 1015 lines of code will probably lead to degradation in outputs (empircally speaking).

(And don’t hate on my 1000+ files please, will split later :wink: )

Thanks guys!