Skip to content

prompt improvement: get 100 buffer lines above and below instead of whole file#159

Open
ataha322 wants to merge 1 commit intoThePrimeagen:masterfrom
ataha322:ata/contrib
Open

prompt improvement: get 100 buffer lines above and below instead of whole file#159
ataha322 wants to merge 1 commit intoThePrimeagen:masterfrom
ataha322:ata/contrib

Conversation

@ataha322
Copy link

@ataha322 ataha322 commented Mar 16, 2026

Note

Low Risk
Low risk: only changes prompt context generation for visual selections by limiting included buffer text, with minimal impact beyond prompt contents and potential off-by-one range edge cases.

Overview
Updates the visual_selection prompt to embed only nearby buffer context (100 lines above/below the selection) instead of dumping the entire file.

Adds get_surrounding_context(range, n) to compute the bounded slice of buffer lines used in the prompt, reducing prompt size and improving relevance.

Written by Cursor Bugbot for commit e939b97. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@cursor
Copy link

cursor bot commented Mar 16, 2026

You have used all of your free Bugbot PR reviews.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link
Owner

@ThePrimeagen ThePrimeagen left a comment

Choose a reason for hiding this comment

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

fix pweeze

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